ownsql: Implement the transaction functions.

This commit is contained in:
Klaas Freitag 2014-10-15 19:47:25 +02:00
parent 6c92076ec3
commit 89c51e7649

View File

@ -68,12 +68,20 @@ void SqlDatabase::close()
bool SqlDatabase::transaction()
{
return true;
if( ! _db ) {
return false;
}
SQLITE_DO(sqlite3_exec(_db, "BEGIN", 0, 0, 0));
return _errId == SQLITE_OK;
}
bool SqlDatabase::commit()
{
return true;
if( ! _db ) {
return false;
}
SQLITE_DO(sqlite3_exec(_db, "COMMIT", 0, 0, 0));
return _errId == SQLITE_OK;
}
sqlite3* SqlDatabase::sqliteDb()