diff options
author | Shauren <shauren.trinity@gmail.com> | 2023-12-15 12:06:59 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2023-12-15 12:06:59 +0100 |
commit | d958bfd0f32bfe798809b72c1b51c990edfe141c (patch) | |
tree | c9c85d770db94239bc24679f31f2c015653b8daa /src/server/database/Database/PreparedStatement.h | |
parent | ee95a5e00fb2ee6928a819699ab93094d916d372 (diff) |
Core/Database: Replace DatabaseWorker with asio io_context
Diffstat (limited to 'src/server/database/Database/PreparedStatement.h')
-rw-r--r-- | src/server/database/Database/PreparedStatement.h | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/server/database/Database/PreparedStatement.h b/src/server/database/Database/PreparedStatement.h index af4db9c310e..9fde41e6f2a 100644 --- a/src/server/database/Database/PreparedStatement.h +++ b/src/server/database/Database/PreparedStatement.h @@ -18,11 +18,14 @@ #ifndef _PREPAREDSTATEMENT_H #define _PREPAREDSTATEMENT_H +#include "DatabaseEnvFwd.h" #include "Define.h" -#include "SQLOperation.h" -#include <future> -#include <vector> +#include <array> +#include <string> #include <variant> +#include <vector> + +class MySQLConnection; struct PreparedStatementData { @@ -112,18 +115,11 @@ private: }; //- Lower-level class, enqueuable operation -class TC_DATABASE_API PreparedStatementTask : public SQLOperation +class TC_DATABASE_API PreparedStatementTask { - public: - PreparedStatementTask(PreparedStatementBase* stmt, bool async = false); - ~PreparedStatementTask(); - - bool Execute() override; - PreparedQueryResultFuture GetFuture() { return m_result->get_future(); } - - protected: - PreparedStatementBase* m_stmt; - bool m_has_result; - PreparedQueryResultPromise* m_result; +public: + static PreparedQueryResult Query(MySQLConnection* conn, PreparedStatementBase* stmt); + static bool Execute(MySQLConnection* conn, PreparedStatementBase* stmt); }; + #endif |