diff options
author | Shauren <shauren.trinity@gmail.com> | 2023-12-15 12:06:59 +0100 |
---|---|---|
committer | funjoker <funjoker109@gmail.com> | 2023-12-19 14:14:23 +0100 |
commit | e0d45f6dff3afe5caa38c48646f23d966c8c03a1 (patch) | |
tree | 6d1b9fef794cec268fa86398d9bb8957cf99f5ba /src/server/database/Database/PreparedStatement.h | |
parent | 575fc7fde329ab47e517357d74a47316c6413544 (diff) |
Core/Database: Replace DatabaseWorker with asio io_context
(cherry picked from commit d958bfd0f32bfe798809b72c1b51c990edfe141c)
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 |