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) {
76 .execute_async(
new database::mariadb::commands::sync::MariaDBUseResultCommand(
77 [&lastResult = sequence.lastResult](MYSQL_RES* result) {
84 [&lastResult = sequence.lastResult]() {
91 const std::function<
void(
void)>& onExec,
92 const std::function<
void(
const std::string&,
unsigned int)>& onError) {
97 const std::function<
void(
const std::string&,
unsigned int)>& onError) {
98 return execute_async(
new database::mariadb::commands::async::MariaDBAutoCommitCommand(0, onAutoCommit, onError));
102 const std::function<
void(
const std::string&,
unsigned int)>& onError) {
103 return execute_async(
new database::mariadb::commands::async::MariaDBAutoCommitCommand(1, onAutoCommit, onError));
107 const std::function<
void(
const std::string&,
unsigned int)>& onError) {
112 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)
MariaDBCommandSequence & execute_async(MariaDBCommand *mariaDBCommand) final