SNode.C
Loading...
Searching...
No Matches
MariaDBConnectCommand.h
Go to the documentation of this file.
1/*
2 * SNode.C - a slim toolkit for network communication
3 * Copyright (C) Volker Christian <me@vchrist.at>
4 * 2020, 2021, 2022, 2023, 2024, 2025
5 * 2021, 2022 Daniel Flockert
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published
9 * by the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef DATABASE_MARIADB_COMMANDS_ASYNC_MARIADBCONNECTCOMMAND
22#define DATABASE_MARIADB_COMMANDS_ASYNC_MARIADBCONNECTCOMMAND
23
24#include "database/mariadb/MariaDBCommandASync.h" // IWYU pragma: export
25#include "database/mariadb/MariaDBConnectionDetails.h"
26
27#ifndef DOXYGEN_SHOULD_SKIP_THIS
28
29#endif /* DOXYGEN_SHOULD_SKIP_THIS */
30
31namespace database::mariadb::commands::async {
32
34 public:
36 const std::function<void(void)>& onConnecting,
37 const std::function<void(void)>& onConnect,
38 const std::function<void(const std::string&, unsigned int)>& onError);
39
40 private:
41 int commandStart() override;
42 int commandContinue(int status) override;
43 bool commandCompleted() override;
44 void commandError(const std::string& errorString, unsigned int errorNumber) override;
45 std::string commandInfo() override;
46
47 MYSQL* ret = nullptr;
49
50 const std::function<void(void)> onConnecting;
51 const std::function<void(void)> onConnect;
52 };
53
54} // namespace database::mariadb::commands::async
55
56#endif // DATABASE_MARIADB_COMMANDS_ASYNC_MARIADBCONNECTCOMMAND
MariaDBConnectCommand(const database::mariadb::MariaDBConnectionDetails &details, const std::function< void(void)> &onConnecting, const std::function< void(void)> &onConnect, const std::function< void(const std::string &, unsigned int)> &onError)
void commandError(const std::string &errorString, unsigned int errorNumber) override
const database::mariadb::MariaDBConnectionDetails details