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

41 lines
676 B
C
Raw Normal View History

#pragma once
#include <string>
#include "Operation.h"
2018-10-24 12:53:26 +02:00
#include <memory>
namespace Sapphire::Db
{
2018-10-28 21:53:21 +01:00
class PreparedStatement;
class StatementTask : public Operation
2018-10-28 21:53:21 +01:00
{
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
private:
std::string m_sql;
bool m_hasResult;
};
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;
protected:
std::shared_ptr< PreparedStatement > m_stmt;
bool m_hasResult;
};
}