Added new methods for transaction to RetroDb.

This commit is contained in:
thunder2 2015-08-15 17:06:06 +02:00
parent 4309642d14
commit 3665238e61
3 changed files with 58 additions and 14 deletions

View file

@ -264,6 +264,32 @@ std::string RetroDb::getKey() const
return mKey;
}
bool RetroDb::beginTransaction()
{
if (!isOpen()) {
return false;
}
return execSQL("BEGIN;");
}
bool RetroDb::commitTransaction()
{
if (!isOpen()) {
return false;
}
return execSQL("COMMIT;");
}
bool RetroDb::rollbackTransaction()
{
if (!isOpen()) {
return false;
}
return execSQL("ROLLBACK;");
}
bool RetroDb::execSQL_bind(const std::string &query, std::list<RetroBind*> &paramBindings){
// prepare statement