From 54f53857279644914e0c2a2aed24060f31ed2575 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 15 May 2018 00:09:17 +0200 Subject: Implement exception safe sqlite transaction class (rollback) --- include/odhtdb/sql/Sql.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include') diff --git a/include/odhtdb/sql/Sql.hpp b/include/odhtdb/sql/Sql.hpp index 6c78360..cb740a4 100644 --- a/include/odhtdb/sql/Sql.hpp +++ b/include/odhtdb/sql/Sql.hpp @@ -34,4 +34,15 @@ namespace odhtdb }; const Type type; }; + + class SqlTransaction + { + public: + SqlTransaction(sqlite3 *db); + ~SqlTransaction(); + + void commit(); + private: + sqlite3 *db; + }; } -- cgit v1.2.3