more on database
This commit is contained in:
parent
5e5ba3b31f
commit
caa35b36ac
2 changed files with 12 additions and 0 deletions
|
@ -19,3 +19,13 @@ void Database::exec(const std::string& sql)
|
||||||
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