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/database.hxx | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'odb/sqlite/database.hxx') diff --git a/odb/sqlite/database.hxx b/odb/sqlite/database.hxx index cfff30f..0eadbbf 100644 --- a/odb/sqlite/database.hxx +++ b/odb/sqlite/database.hxx @@ -28,12 +28,11 @@ namespace odb { namespace sqlite { + class transaction_impl; + class LIBODB_SQLITE_EXPORT database: public odb::database { public: - typedef sqlite::connection connection_type; - - public: database (const std::string& name, int flags = SQLITE_OPEN_READWRITE, std::auto_ptr = @@ -77,14 +76,10 @@ namespace odb return flags_; } + // Transactions. + // public: - using odb::database::execute; - - virtual unsigned long long - execute (const char* statement, std::size_t length); - - public: - virtual transaction_impl* + transaction_impl* begin (); transaction_impl* @@ -94,13 +89,17 @@ namespace odb begin_exclusive (); public: - details::shared_ptr + connection_ptr connection (); public: virtual ~database (); + protected: + virtual odb::connection* + connection_ (); + private: std::string name_; int flags_; -- cgit v1.1