1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-29 23:57:46 +00:00
sapphire/src/common/Database/StatementTask.h

55 lines
1 KiB
C
Raw Normal View History

#ifndef SAPPHIRE_STATEMENTTASK_H
#define SAPPHIRE_STATEMENTTASK_H
#include <string>
#include "Operation.h"
2018-10-24 12:53:26 +02:00
#include <memory>
2018-10-28 21:53:21 +01:00
namespace Core::Db
{
2018-10-28 21:53:21 +01:00
class PreparedStatement;
2018-10-28 21:53:21 +01:00
class StatementTask :
public Operation
{
public:
2018-10-28 21:53:21 +01:00
StatementTask( const std::string& sql, bool async = false );
2018-10-28 21:53:21 +01:00
~StatementTask();
2018-10-28 21:53:21 +01:00
bool execute() override;
2018-10-28 21:53:21 +01:00
// QueryResultFuture getFuture() const
// {
// return m_result->get_future();
// }
2018-10-28 21:53:21 +01:00
private:
std::string m_sql;
bool m_hasResult;
// QueryResultPromise *m_result;
};
2018-10-28 21:53:21 +01:00
class PreparedStatementTask :
public Operation
{
public:
PreparedStatementTask( std::shared_ptr< PreparedStatement > stmt, bool async = false );
2018-10-28 21:53:21 +01:00
~PreparedStatementTask();
2018-10-28 21:53:21 +01:00
bool execute() override;
//PreparedQueryResultFuture getFuture() { return m_result->get_future(); }
protected:
std::shared_ptr< PreparedStatement > m_stmt;
bool m_hasResult;
//PreparedQueryResultPromise* m_result;
};
}
#endif //SAPPHIRE_STATEMENTTASK_H