database: Add interface to handle transactions

This commit is contained in:
Tobias Brunner
2013-10-11 15:16:04 +02:00
parent 5f6a40827e
commit 947b76cda8
3 changed files with 76 additions and 1 deletions
@@ -1,4 +1,5 @@
/*
* Copyright (C) 2013 Tobias Brunner
* Copyright (C) 2007 Martin Willi
* Hochschule fuer Technik Rapperswil
*
@@ -280,6 +281,24 @@ METHOD(database_t, execute, int,
return affected;
}
METHOD(database_t, transaction, bool,
private_sqlite_database_t *this)
{
return FALSE;
}
METHOD(database_t, commit, bool,
private_sqlite_database_t *this)
{
return FALSE;
}
METHOD(database_t, rollback, bool,
private_sqlite_database_t *this)
{
return FALSE;
}
METHOD(database_t, get_driver, db_driver_t,
private_sqlite_database_t *this)
{
@@ -330,6 +349,9 @@ sqlite_database_t *sqlite_database_create(char *uri)
.db = {
.query = _query,
.execute = _execute,
.transaction = _transaction,
.commit = _commit,
.rollback = _rollback,
.get_driver = _get_driver,
.destroy = _destroy,
},