diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-08-21 16:27:34 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-08-21 16:27:34 +0200 |
commit | 5694c0a4529334756f2b914ad67408df199551dc (patch) | |
tree | 38daa2e27d6049ca7a808af642eb82a29c9d2886 /odb/sqlite/database.hxx | |
parent | 1bf4678c29b6e51396c18582b270254d1bd2cddc (diff) |
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.
Diffstat (limited to 'odb/sqlite/database.hxx')
-rw-r--r-- | odb/sqlite/database.hxx | 21 |
1 files changed, 10 insertions, 11 deletions
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<connection_factory> = @@ -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_type> + connection_ptr connection (); public: virtual ~database (); + protected: + virtual odb::connection* + connection_ (); + private: std::string name_; int flags_; |