AnCH Framework 0.1
Another C++ Hack Framework
 
Loading...
Searching...
No Matches
mysqlConnection.hpp
1/*
2 ANCH Framework: ANother C++ Hack is a C++ framework based on C++11 standard
3 Copyright (C) 2012 Vincent Lachenal
4
5 This file is part of ANCH Framework.
6
7 ANCH Framework is free software: you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 ANCH Framework 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 ANCH Framework. If not, see <http://www.gnu.org/licenses/>.
19*/
20#ifdef ANCH_SQL_MYSQL
21#pragma once
22
23#include <string>
24#include <functional>
25#include "mysql.h"
26
27#include "sql/connection.hpp"
28
29//typedef struct st_mysql MYSQL;
30//struct MYSQL;
31
32namespace anch {
33 namespace sql {
34
45
46 // Attributes +
47 private:
49 MYSQL* _mysql;
50 // Attributes -
51
52 // Constructors +
53 public:
62
67 // Constructors -
68
69 // Destructor +
73 virtual ~MySQLConnection() noexcept;
74 // Destructor -
75
76 // Methods +
77 protected:
87 virtual ResultSet* executeQuery(const std::string& query) override;
88
98 virtual uint64_t executeUpdate(const std::string& query) override;
99
105 virtual void sendCommit() override;
106
112 virtual void sendRollback() override;
113
119 virtual void sendStartTransaction() override;
120
130 virtual PreparedStatement* makePrepared(const std::string& query) override;
131 // Methods -
132
133 };
134
135 }
136}
137
138#endif // ANCH_SQL_MYSQL
ResultSet * query(const std::string &query)
virtual ResultSet * executeQuery(const std::string &query) override
virtual void sendRollback() override
MySQLConnection(const MySQLConnection &)
virtual void sendStartTransaction() override
virtual uint64_t executeUpdate(const std::string &query) override
virtual void sendCommit() override
virtual ~MySQLConnection() noexcept
virtual PreparedStatement * makePrepared(const std::string &query) override
MySQLConnection(const SqlConnectionConfiguration &config)
SQL prepared statement.
Definition preparedStatement.hpp:43
SQL result representation.
Definition resultSet.hpp:50
SQL namespace.
Definition clauses.hpp:26
AnCH framework base namespace.
Definition app.hpp:28
SQL database connection configuration.
Definition connection.hpp:39