AnCH Framework  0.1
Another C++ Hack Framework
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Protected Member Functions | List of all members
anch::sql::SQLite3Connection Class Reference

SQLite3 connection. More...

#include <sqlite3Connection.hpp>

Inheritance diagram for anch::sql::SQLite3Connection:
Collaboration diagram for anch::sql::SQLite3Connection:

Public Member Functions

 SQLite3Connection (const std::string &database) throw (SqlException)
 
 SQLite3Connection (const SqlConnectionConfiguration &config) throw (SqlException)
 
 SQLite3Connection (const SQLite3Connection &)=delete
 
 ~SQLite3Connection ()
 
- Public Member Functions inherited from anch::sql::Connection
 Connection () throw (SqlException)
 
 Connection (const Connection &)=delete
 
virtual ~Connection ()
 
void commit () throw (SqlException)
 
void rollback () throw (SqlException)
 
void setAutoCommit (bool autoCommit) throw (SqlException)
 
ResultSetquery (const std::string &query) throw (SqlException)
 
void queryMapRow (const std::string &sqlQuery, std::function< void(ResultSet &)> rowMapper) throw (SqlException)
 
void queryExtract (const std::string &sqlQuery, std::function< void(ResultSet &)> resExtractor) throw (SqlException)
 
uint64_t update (const std::string &query) throw (SqlException)
 
bool isAutoCommit () const
 
bool isValid () const
 

Protected Member Functions

virtual ResultSetexecuteQuery (const std::string &query) override throw (SqlException)
 
virtual uint64_t executeUpdate (const std::string &query) override throw (SqlException)
 
virtual void sendCommit () override throw (SqlException)
 
virtual void sendRollback () override throw (SqlException)
 
virtual void toggleAutoCommit (bool autoCommit) override throw (SqlException)
 
- Protected Member Functions inherited from anch::sql::Connection
void setValid (bool valid)
 

Additional Inherited Members

- Protected Attributes inherited from anch::sql::Connection
bool _autoCommit
 
bool _valid
 

Detailed Description

SQLite3 connection.

SQL connection implementation through SQLite3 native library

Author
Vincent Lachenal
Since
0.1

Constructor & Destructor Documentation

SQLite3Connection::SQLite3Connection ( const std::string &  database)
throw (SqlException
)

SQLite3Connection constructor

Parameters
databasethe database path
Exceptions
SqlExceptionfail to create connection
SQLite3Connection::SQLite3Connection ( const SqlConnectionConfiguration config)
throw (SqlException
)

SQLite3Connection constructor

Parameters
configthe SQLite3 configuration
Exceptions
SqlExceptionfail to create connection
anch::sql::SQLite3Connection::SQLite3Connection ( const SQLite3Connection )
delete

Prohibit SQLite3Connection copy constructor

SQLite3Connection::~SQLite3Connection ( )

SQLite3Connection destructor

Member Function Documentation

ResultSet * SQLite3Connection::executeQuery ( const std::string &  query)
throw (SqlException
)
overrideprotectedvirtual

Execute SQL select query

Parameters
querythe SQL query to execute
Returns
the result set
Exceptions
SqlExceptionany error

Implements anch::sql::Connection.

uint64_t SQLite3Connection::executeUpdate ( const std::string &  query)
throw (SqlException
)
overrideprotectedvirtual

Execute SQL update query

Parameters
querythe SQL query to execute
Returns
the number of updated rows
Exceptions
SqlExceptionany error

Implements anch::sql::Connection.

void SQLite3Connection::sendCommit ( )
throw (SqlException
)
overrideprotectedvirtual

Send commit to database server

Exceptions
SqlExceptionfail to commit transaction

Implements anch::sql::Connection.

void SQLite3Connection::sendRollback ( )
throw (SqlException
)
overrideprotectedvirtual

Send rollback to database server

Exceptions
SqlExceptionfail to rollback transaction

Implements anch::sql::Connection.

void SQLite3Connection::toggleAutoCommit ( bool  autoCommit)
throw (SqlException
)
overrideprotectedvirtual

Send auto commit status modification to server

Parameters
autoCommitthe status to send
Exceptions
SqlExceptionany error

Implements anch::sql::Connection.


The documentation for this class was generated from the following files: