From 4a0d1ff39ec150d8e8c04ca846b3116884e1774e Mon Sep 17 00:00:00 2001 From: dec05eba <0xdec05eba@gmail.com> 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