AnCH Framework 0.1
Another C++ Hack Framework
 
Loading...
Searching...
No Matches
mysqlPreparedStatement.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 "sql/preparedStatement.hpp"
24#include "sql/mysqlConnection.hpp"
25
26#include <atomic>
27#include "mysql.h"
28
29//typedef struct st_mysql_stmt MYSQL_STMT;
30//struct MYSQL_STMT;
31
32namespace anch {
33 namespace sql {
34
35 class MySQLConnection;
36
47
48 // Attributes +
49 private:
51 static std::atomic<std::uint64_t> _counter;
52
54 MYSQL* _conn;
55
57 MYSQL_STMT* _stmt;
58
60 std::string _stmtId;
61 // Attributes -
62
63 // Constructors +
64 public:
73 MySQLPreparedStatement(MYSQL* dbCon, const std::string& query);
74 // Constructors -
75
76 // Destructor +
77 public:
81 virtual ~MySQLPreparedStatement() noexcept;
82 // Destructor -
83
84 // Methods +
85 public:
93 virtual ResultSet* executeQuery() override;
94
102 virtual uint64_t executeUpdate() override;
103 // Methods -
104
105 };
106
107 }
108}
109
110#endif // ANCH_SQL_MYSQL
MySQL connection.
Definition mysqlConnection.hpp:44
virtual uint64_t executeUpdate() override
MySQLPreparedStatement(MYSQL *dbCon, const std::string &query)
virtual ResultSet * executeQuery() override
virtual ~MySQLPreparedStatement() noexcept
SQL result representation.
Definition resultSet.hpp:50
SQL namespace.
Definition clauses.hpp:26
AnCH framework base namespace.
Definition app.hpp:28