From 5694c0a4529334756f2b914ad67408df199551dc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 21 Aug 2011 16:27:34 +0200 Subject: Add odb::connection class This abstract class represents a connection to the database. One can use it to start a transaction or to execute a native statement out of a transaction. Before we had concrete connection classes in the database runtime libraries (e.g., odb::mysql::connection). Now these classes derive from odb::connection. --- odb/sqlite/connection.hxx | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'odb/sqlite/connection.hxx') diff --git a/odb/sqlite/connection.hxx b/odb/sqlite/connection.hxx index 3ae82e3..e069ce9 100644 --- a/odb/sqlite/connection.hxx +++ b/odb/sqlite/connection.hxx @@ -13,12 +13,14 @@ #include // std::auto_ptr #include +#include #include #include #include #include #include +#include #include namespace odb @@ -28,7 +30,10 @@ namespace odb class statement; class statement_cache; - class LIBODB_SQLITE_EXPORT connection: public details::shared_base + class connection; + typedef details::shared_ptr connection_ptr; + + class LIBODB_SQLITE_EXPORT connection: public odb::connection { public: typedef sqlite::statement_cache statement_cache_type; @@ -46,6 +51,22 @@ namespace odb } public: + virtual transaction_impl* + begin (); + + transaction_impl* + begin_immediate (); + + transaction_impl* + begin_exclusive (); + + public: + using odb::connection::execute; + + virtual unsigned long long + execute (const char* statement, std::size_t length); + + public: sqlite3* handle () { -- cgit v1.1