2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
43#include "database/mariadb/MariaDBClientASyncAPI.h"
45#include "database/mariadb/MariaDBCommandSequence.h"
46#include "database/mariadb/commands/async/MariaDBAutoCommitCommand.h"
47#include "database/mariadb/commands/async/MariaDBCommitCommand.h"
48#include "database/mariadb/commands/async/MariaDBExecCommand.h"
49#include "database/mariadb/commands/async/MariaDBFetchRowCommand.h"
50#include "database/mariadb/commands/async/MariaDBFreeResultCommand.h"
51#include "database/mariadb/commands/async/MariaDBQueryCommand.h"
52#include "database/mariadb/commands/async/MariaDBRollbackCommand.h"
53#include "database/mariadb/commands/sync/MariaDBUseResultCommand.h"
55#ifndef DOXYGEN_SHOULD_SKIP_THIS
67 const std::function<
void(
const MYSQL_ROW)>& onQuery,
68 const std::function<
void(
const std::string&,
unsigned int)>& onError) {
69 return execute_async(
new database::mariadb::commands::async::MariaDBQueryCommand(
74 .execute_async(
new database::mariadb::commands::sync::MariaDBUseResultCommand(
75 [&lastResult =
this->lastResult](MYSQL_RES* result) {
79 .execute_async(
new database::mariadb::commands::async::MariaDBFetchRowCommand(lastResult, onQuery, onError))
80 .execute_async(
new database::mariadb::commands::async::MariaDBFreeResultCommand(
89 const std::function<
void(
void)>& onExec,
90 const std::function<
void(
const std::string&,
unsigned int)>& onError) {
95 const std::function<
void(
const std::string&,
unsigned int)>& onError) {
96 return execute_async(
new database::mariadb::commands::async::MariaDBAutoCommitCommand(0, onAutoCommit, onError));
100 const std::function<
void(
const std::string&,
unsigned int)>& onError) {
101 return execute_async(
new database::mariadb::commands::async::MariaDBAutoCommitCommand(1, onAutoCommit, onError));
105 const std::function<
void(
const std::string&,
unsigned int)>& onError) {
110 const std::function<
void(
const std::string&,
unsigned int)>& onError) {
MariaDBCommandSequence & commit(const std::function< void(void)> &onCommit, const std::function< void(const std::string &, unsigned int)> &onError)
virtual MariaDBCommandSequence & execute_async(MariaDBCommand *mariaDBCommand)=0
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)