From d958bfd0f32bfe798809b72c1b51c990edfe141c Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 15 Dec 2023 12:06:59 +0100 Subject: Core/Database: Replace DatabaseWorker with asio io_context --- src/server/database/Database/PreparedStatement.h | 26 ++++++++++-------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'src/server/database/Database/PreparedStatement.h') 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 -#include +#include +#include #include +#include + +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 -- cgit v1.2.3