SQLite3 connection. More...
#include <sqlite3Connection.hpp>
Public Member Functions | |
SQLite3Connection (const std::string &database) | |
SQLite3Connection (const SqlConnectionConfiguration &config) | |
SQLite3Connection (const SQLite3Connection &)=delete | |
virtual | ~SQLite3Connection () noexcept |
![]() | |
Connection () | |
Connection (const Connection &)=delete | |
virtual | ~Connection () noexcept |
void | startTransaction () |
void | begin () |
void | commit () |
void | rollback () |
void | release () noexcept |
PreparedStatement & | prepareStatement (const std::string &query) |
ResultSet * | query (const std::string &query) |
void | queryMapRow (const std::string &sqlQuery, std::function< void(ResultSet &)> rowMapper) |
void | queryExtract (const std::string &sqlQuery, std::function< void(ResultSet &)> resExtractor) |
template<typename T, typename... Q> | |
ResultSet * | query (const std::string &query, const T &value, const Q &... values) |
template<typename T, typename... Q> | |
void | queryMapRow (const std::string &query, std::function< void(ResultSet &)> rowMapper, const T &value, const Q &... values) |
template<typename T, typename... Q> | |
void | queryExtract (const std::string &query, std::function< void(ResultSet &)> resExtractor, const T &value, const Q &... values) |
uint64_t | update (const std::string &query) |
template<typename T, typename... Q> | |
uint64_t | update (const std::string &query, const T &value, const Q &... values) |
template<typename T, typename Iterable> | |
uint64_t | batchUpdate (const std::string &query, std::function< void(PreparedStatement &, const T &)> mapper, const Iterable &values) |
bool | isValid () const noexcept |
Protected Member Functions | |
virtual ResultSet * | executeQuery (const std::string &query) override |
virtual uint64_t | executeUpdate (const std::string &query) override |
virtual void | sendCommit () override |
virtual void | sendRollback () override |
virtual void | sendStartTransaction () override |
virtual PreparedStatement * | makePrepared (const std::string &query) override |
![]() | |
void | setValid (bool valid) noexcept |
Additional Inherited Members | |
![]() | |
bool | _valid |
bool | _transaction |
std::map< std::string, PreparedStatement * > | _stmts |
bool | _errors |
SQLite3 connection.
SQL connection implementation through SQLite3 native library
anch::sql::SQLite3Connection::SQLite3Connection | ( | const std::string & | database | ) |
SQLite3Connection constructor
database | the database path |
SqlException | fail to create connection |
anch::sql::SQLite3Connection::SQLite3Connection | ( | const SqlConnectionConfiguration & | config | ) |
SQLite3Connection constructor
config | the SQLite3 configuration |
SqlException | fail to create connection |
|
delete |
|
virtualnoexcept |
SQLite3Connection destructor
|
overrideprotectedvirtual |
Execute SQL select query
query | the SQL query to execute |
SqlException | any error |
Implements anch::sql::Connection.
|
overrideprotectedvirtual |
Execute SQL update query
query | the SQL query to execute |
SqlException | any error |
Implements anch::sql::Connection.
|
overrideprotectedvirtual |
Send SQL query to prepare SQL statement
query | the SQL query |
SqlException | any error |
Implements anch::sql::Connection.
|
overrideprotectedvirtual |
Send commit to database server
SqlException | fail to commit transaction |
Implements anch::sql::Connection.
|
overrideprotectedvirtual |
Send rollback to database server
SqlException | fail to rollback transaction |
Implements anch::sql::Connection.
|
overrideprotectedvirtual |
Send start transaction to database server
SqlException | any error |
Implements anch::sql::Connection.