diff options
Diffstat (limited to 'src/database/select_query.hpp')
-rw-r--r-- | src/database/select_query.hpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/database/select_query.hpp b/src/database/select_query.hpp index e372f2e..1399417 100644 --- a/src/database/select_query.hpp +++ b/src/database/select_query.hpp @@ -8,6 +8,7 @@ #include <database/query.hpp> #include <logger/logger.hpp> #include <database/row.hpp> +#include <database/async_result.hpp> #include <utils/optional_bool.hpp> @@ -131,6 +132,15 @@ struct SelectQuery: public Query return rows; } + AsyncResult<T...> execute_async(DatabaseEngine& db) + { + auto statement = db.prepare(this->body); + if (!statement) + return {{}, {}}; + statement->bind(std::move(this->params)); + return {std::move(statement), this->table_name}; + } + const std::string table_name; }; |