DUNE: Uniform Navigational Environment
2016.05.0
|
Database connection.
Public Member Functions | |
Connection (const char *path, bool create=false) | |
~Connection () | |
void | execute (const char *sql_stmt, int *count=0) |
void | beginTransaction (void) |
void | commit (void) |
void | rollback (void) |
const char * | lastError (void) |
DB_HANDLE * | handle (void) |
Static Public Attributes | |
static const char * | c_memory_db |
DUNE::Database::Connection::Connection | ( | const char * | path, |
bool | create = false |
||
) |
Constructor.
path | database file |
create | create database if it does not exist |
References lastError(), and DUNE::Database::Statement.
DUNE::Database::Connection::~Connection | ( | void | ) |
Destructor.
void DUNE::Database::Connection::beginTransaction | ( | void | ) |
Begin transaction.
References DUNE::Database::Statement::execute().
void DUNE::Database::Connection::commit | ( | void | ) |
Commit (end) current transaction.
References DUNE::Database::Statement::execute().
void DUNE::Database::Connection::execute | ( | const char * | sql_stmt, |
int * | count = 0 |
||
) |
Execute an SQL statement directly and optionally obtain the number of affected rows for (INSERT, UPDATE, and DELETE statements).
sql_stmt | SQL statement |
count | optional argument to get number of affected rows |
|
inline |
Get internal database connection handle.
This is for use by other classes in the package.
Referenced by DUNE::Database::Statement::execute(), and DUNE::Database::Statement::Statement().
const char * DUNE::Database::Connection::lastError | ( | void | ) |
Get description of last error.
Referenced by Connection().
void DUNE::Database::Connection::rollback | ( | void | ) |
Rollback current transaction.
References DUNE::Database::Statement::execute().
|
static |
Identifier to use for temporary, memory-only based databases.