#include <sqlite.hpp>
Only a sigle thread at a time can have an SqliteSession, all other threads will wait, in the SqliteSession constructor, till the active session is either closed or destructed.
Public Member Functions | |
| SqliteSession (Sqlite *sqlite) | |
| Locks the database. | |
| template<typename T> | |
| SqliteQuery | query (T t) |
| A shorter way to construct query from the session. | |
| ~SqliteSession () | |
| Automatically unlocks the database. | |
| void | close () |
| Unlock the database. | |
| bool | isClosed () const |
True if the close method has been already called on this SqliteSession. | |
| operator::sqlite3 * () const | |
| This class can be used in place of the SQLite handler. | |
Protected Attributes | |
| Sqlite * | db |
|
|
Locks the database.
|
|
|
Automatically unlocks the database.
|
|
|
Unlock the database.
It is safe to call this method multiple times.
|
|
|
This class can be used in place of the SQLite handler. Make sure you've released any resources thus manually acquired before this SqliteSession is closed. Usage example: glim::Sqlite db (":memory:"); glim::SqliteSession ses (&db); sqlite3_exec (ses, "PRAGMA page_size = 4096;", NULL, NULL, NULL); |
|
||||||||||
|
A shorter way to construct query from the session. Usage example: ses.query(S("create table test (i integer)")).step()
|
1.4.6