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 | e84fa8e3b8defe24a00e14ba046e8e71b438ce0b (patch) | |
tree | 2d17fab73f0bbb1a96f365e38ecbd63e033af36f /odb/mysql/database.hxx | |
parent | 47d344f31f7a1a980d807c142e0a36b09db3b1f3 (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/mysql/database.hxx')
-rw-r--r-- | odb/mysql/database.hxx | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/odb/mysql/database.hxx b/odb/mysql/database.hxx index 5e2ebc6..37b966f 100644 --- a/odb/mysql/database.hxx +++ b/odb/mysql/database.hxx @@ -19,7 +19,6 @@ #include <odb/mysql/forward.hxx> #include <odb/mysql/connection.hxx> #include <odb/mysql/connection-factory.hxx> -#include <odb/mysql/transaction-impl.hxx> #include <odb/details/shared-ptr.hxx> @@ -29,12 +28,11 @@ namespace odb { namespace mysql { + class transaction_impl; + class LIBODB_MYSQL_EXPORT database: public odb::database { public: - typedef mysql::connection connection_type; - - public: // In MySQL, NULL and empty string are treated as the same value // for all the arguments except passwd and socket. // @@ -159,23 +157,21 @@ namespace odb } public: - using odb::database::execute; - - virtual unsigned long long - execute (const char* statement, std::size_t length); - - public: - virtual transaction_impl* + transaction_impl* begin (); public: - details::shared_ptr<connection_type> + connection_ptr connection (); public: virtual ~database (); + protected: + virtual odb::connection* + connection_ (); + private: std::string user_; std::string passwd_str_; |