AnCH Framework 0.2
Another C++ Hack: C++23 utility libraries
Loading...
Searching...
No Matches
sqlite3PreparedStatement.hpp
1/*
2 ANCH Framework: ANother C++ Hack is a C++ framework based on C++23 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 <https://www.gnu.org/licenses/>.
19*/
20#ifdef ANCH_SQL_SQLITE3
21#pragma once
22
23#include "anch-sqlite-export.hpp"
24
25#include "sql/preparedStatement.hpp"
26#include "sql/sqlite3Connection.hpp"
27
28#include <atomic>
29
30struct sqlite3;
31struct sqlite3_stmt;
32
33
34namespace anch::sql {
35
37
47 class ANCH_SQLITE_EXPORT SQLite3PreparedStatement: public PreparedStatement {
48
49 // Attributes +
50 private:
52 static std::atomic<std::uint64_t> _counter;
53
55 sqlite3* _conn;
56
58 sqlite3_stmt* _stmt;
59 // Attributes -
60
61 // Constructors +
62 public:
71 SQLite3PreparedStatement(sqlite3* dbCon, const std::string& query);
72 // Constructors -
73
74 // Destructor +
75 public:
79 virtual ~SQLite3PreparedStatement() noexcept;
80 // Destructor -
81
82 // Methods +
83 protected:
91 virtual void doPrepare(const std::string& query) override;
92
100 virtual ResultSet* doExecuteQuery() override;
101
109 virtual uint64_t doExecuteUpdate() override;
110 // Methods -
111
112 };
113
114} // anch::sql
115
116#endif // ANCH_SQL_SQLITE3
SQLite3 connection.
Definition sqlite3Connection.hpp:69
SQLite3PreparedStatement(sqlite3 *dbCon, const std::string &query)
virtual ~SQLite3PreparedStatement() noexcept
virtual uint64_t doExecuteUpdate() override
virtual ResultSet * doExecuteQuery() override
virtual void doPrepare(const std::string &query) override
SQL namespace.
Definition clauses.hpp:28