mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 22:57:45 +00:00
55 lines
1 KiB
C
55 lines
1 KiB
C
![]() |
#ifndef SAPPHIRE_STATEMENTTASK_H
|
||
|
#define SAPPHIRE_STATEMENTTASK_H
|
||
|
|
||
|
#include <string>
|
||
|
#include "Operation.h"
|
||
|
|
||
|
namespace Core
|
||
|
{
|
||
|
namespace Db
|
||
|
{
|
||
|
class PreparedStatement;
|
||
|
|
||
|
class StatementTask : public Operation
|
||
|
{
|
||
|
public:
|
||
|
|
||
|
StatementTask( const std::string& sql, bool async = false );
|
||
|
|
||
|
~StatementTask();
|
||
|
|
||
|
bool execute() override;
|
||
|
|
||
|
// QueryResultFuture getFuture() const
|
||
|
// {
|
||
|
// return m_result->get_future();
|
||
|
// }
|
||
|
|
||
|
private:
|
||
|
std::string m_sql;
|
||
|
bool m_hasResult;
|
||
|
// QueryResultPromise *m_result;
|
||
|
};
|
||
|
|
||
|
//- Lower-level class, enqueuable operation
|
||
|
class PreparedStatementTask : public Operation
|
||
|
{
|
||
|
public:
|
||
|
PreparedStatementTask( PreparedStatement* stmt, bool async = false);
|
||
|
~PreparedStatementTask();
|
||
|
|
||
|
bool execute() override;
|
||
|
//PreparedQueryResultFuture getFuture() { return m_result->get_future(); }
|
||
|
|
||
|
protected:
|
||
|
PreparedStatement* m_stmt;
|
||
|
bool m_hasResult;
|
||
|
//PreparedQueryResultPromise* m_result;
|
||
|
};
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
#endif //SAPPHIRE_STATEMENTTASK_H
|