more on database

This commit is contained in:
Martin Brodbeck 2018-07-09 21:03:59 +02:00
parent 5e5ba3b31f
commit caa35b36ac
2 changed files with 12 additions and 0 deletions

View file

@ -18,4 +18,14 @@ void Database::exec(const std::string& sql)
if (errCode) {
throw std::runtime_error("Error in SQL execution.");
}
}
void Database::beginTransaction()
{
exec("BEGIN TRANSACTION");
}
void Database::endTransaction()
{
exec("END TRANSACTION");
}

View file

@ -15,6 +15,8 @@ public:
void exec(const std::string& sql);
private:
sqlite3 *db;
void beginTransaction();
void endTransaction();
};
#endif // DATABASE_H