more on database
This commit is contained in:
parent
5e5ba3b31f
commit
caa35b36ac
2 changed files with 12 additions and 0 deletions
|
@ -18,4 +18,14 @@ void Database::exec(const std::string& sql)
|
||||||
if (errCode) {
|
if (errCode) {
|
||||||
throw std::runtime_error("Error in SQL execution.");
|
throw std::runtime_error("Error in SQL execution.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Database::beginTransaction()
|
||||||
|
{
|
||||||
|
exec("BEGIN TRANSACTION");
|
||||||
|
}
|
||||||
|
|
||||||
|
void Database::endTransaction()
|
||||||
|
{
|
||||||
|
exec("END TRANSACTION");
|
||||||
}
|
}
|
|
@ -15,6 +15,8 @@ public:
|
||||||
void exec(const std::string& sql);
|
void exec(const std::string& sql);
|
||||||
private:
|
private:
|
||||||
sqlite3 *db;
|
sqlite3 *db;
|
||||||
|
void beginTransaction();
|
||||||
|
void endTransaction();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DATABASE_H
|
#endif // DATABASE_H
|
Loading…
Reference in a new issue