diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2021-04-29 11:55:45 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2021-04-30 10:07:08 +0200 |
commit | fa3f14db14671b4c37c400880d097b17aa12b824 (patch) | |
tree | 6b516f01505cd743c01d714329068fcd56233f73 /odb/sqlite/connection.hxx | |
parent | 2c15821eb8a9d6a7f79b7194b23d84dd8bb773c7 (diff) |
Move begin/commit/rollback statements to connection
Diffstat (limited to 'odb/sqlite/connection.hxx')
-rw-r--r-- | odb/sqlite/connection.hxx | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/odb/sqlite/connection.hxx b/odb/sqlite/connection.hxx index 254a002..30bb467 100644 --- a/odb/sqlite/connection.hxx +++ b/odb/sqlite/connection.hxx @@ -8,6 +8,7 @@ #include <sqlite3.h> +#include <odb/statement.hxx> #include <odb/connection.hxx> #include <odb/details/mutex.hxx> @@ -29,6 +30,7 @@ namespace odb namespace sqlite { class statement_cache; + class generic_statement; class connection_factory; class connection; @@ -164,6 +166,22 @@ namespace odb void clear (); + public: + generic_statement& + begin_statement (); + + generic_statement& + begin_immediate_statement (); + + generic_statement& + begin_exclusive_statement (); + + generic_statement& + commit_statement (); + + generic_statement& + rollback_statement (); + private: connection (const connection&); connection& operator= (const connection&); @@ -180,6 +198,15 @@ namespace odb // details::unique_ptr<statement_cache_type> statement_cache_; + // Note: using odb::statement in order to break the connection-statement + // dependency cycle. + // + details::shared_ptr<odb::statement> begin_; + details::shared_ptr<odb::statement> begin_immediate_; + details::shared_ptr<odb::statement> begin_exclusive_; + details::shared_ptr<odb::statement> commit_; + details::shared_ptr<odb::statement> rollback_; + // Unlock notification machinery. // private: |