diff --git a/src/core/database.cpp b/src/core/database.cpp index 1ad5f43..0b3207a 100644 --- a/src/core/database.cpp +++ b/src/core/database.cpp @@ -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"); } \ No newline at end of file diff --git a/src/core/database.h b/src/core/database.h index dcb2858..5fcf027 100644 --- a/src/core/database.h +++ b/src/core/database.h @@ -15,6 +15,8 @@ public: void exec(const std::string& sql); private: sqlite3 *db; + void beginTransaction(); + void endTransaction(); }; #endif // DATABASE_H \ No newline at end of file