2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
21#include "database/mariadb/MariaDBClientASyncAPI.h"
23#include "database/mariadb/MariaDBCommandSequence.h"
24#include "database/mariadb/commands/async/MariaDBAutoCommitCommand.h"
25#include "database/mariadb/commands/async/MariaDBCommitCommand.h"
26#include "database/mariadb/commands/async/MariaDBExecCommand.h"
27#include "database/mariadb/commands/async/MariaDBFetchRowCommand.h"
28#include "database/mariadb/commands/async/MariaDBFreeResultCommand.h"
29#include "database/mariadb/commands/async/MariaDBQueryCommand.h"
30#include "database/mariadb/commands/async/MariaDBRollbackCommand.h"
31#include "database/mariadb/commands/sync/MariaDBUseResultCommand.h"
33#ifndef DOXYGEN_SHOULD_SKIP_THIS
45 const std::function<
void(
const MYSQL_ROW)>& onQuery,
46 const std::function<
void(
const std::string&,
unsigned int)>& onError) {
47 return execute_async(
new database::mariadb::commands::async::MariaDBQueryCommand(
52 .execute_async(
new database::mariadb::commands::sync::MariaDBUseResultCommand(
53 [&lastResult =
this->lastResult](MYSQL_RES* result) {
57 .execute_async(
new database::mariadb::commands::async::MariaDBFetchRowCommand(lastResult, onQuery, onError))
58 .execute_async(
new database::mariadb::commands::async::MariaDBFreeResultCommand(
67 const std::function<
void(
void)>& onExec,
68 const std::function<
void(
const std::string&,
unsigned int)>& onError) {
69 return execute_async(
new database::mariadb::commands::async::MariaDBExecCommand(sql, onExec, onError));
73 const std::function<
void(
const std::string&,
unsigned int)>& onError) {
74 return execute_async(
new database::mariadb::commands::async::MariaDBAutoCommitCommand(0, onAutoCommit, onError));
78 const std::function<
void(
const std::string&,
unsigned int)>& onError) {
79 return execute_async(
new database::mariadb::commands::async::MariaDBAutoCommitCommand(1, onAutoCommit, onError));
83 const std::function<
void(
const std::string&,
unsigned int)>& onError) {
84 return execute_async(
new database::mariadb::commands::async::MariaDBCommitCommand(onCommit, onError));
88 const std::function<
void(
const std::string&,
unsigned int)>& onError) {
89 return execute_async(
new database::mariadb::commands::async::MariaDBRollbackCommand(onRollback, onError));
MariaDBCommandSequence & commit(const std::function< void(void)> &onCommit, const std::function< void(const std::string &, unsigned int)> &onError)
MariaDBCommandSequence & startTransactions(const std::function< void(void)> &onAutoCommit, const std::function< void(const std::string &, unsigned int)> &onError)
virtual ~MariaDBClientASyncAPI()
MariaDBCommandSequence & rollback(const std::function< void(void)> &onRollback, const std::function< void(const std::string &, unsigned int)> &onError)
MariaDBCommandSequence & exec(const std::string &sql, const std::function< void(void)> &onExec, const std::function< void(const std::string &, unsigned int)> &onError)
MariaDBCommandSequence & endTransactions(const std::function< void(void)> &onAutoCommit, const std::function< void(const std::string &, unsigned int)> &onError)
MariaDBCommandSequence & query(const std::string &sql, const std::function< void(const MYSQL_ROW)> &onQuery, const std::function< void(const std::string &, unsigned int)> &onError)