diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-11-17 18:05:06 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-11-17 18:05:06 +0200 |
commit | f959f1fb57ba5607573625aecf8ff38e4de9d558 (patch) | |
tree | 8464e6eaf79dbcb56db474b9e81d6d4de457018b /odb/mysql/connection.hxx | |
parent | 81d08ed6587144baaec83522382119a7286a911e (diff) |
Add support for unidirectional object relationships
New test: common/relationship.
Diffstat (limited to 'odb/mysql/connection.hxx')
-rw-r--r-- | odb/mysql/connection.hxx | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/odb/mysql/connection.hxx b/odb/mysql/connection.hxx index 7696909..ca1268a 100644 --- a/odb/mysql/connection.hxx +++ b/odb/mysql/connection.hxx @@ -15,6 +15,7 @@ #include <odb/mysql/mysql.hxx> #include <odb/mysql/version.hxx> +#include <odb/mysql/forward.hxx> #include <odb/details/shared-ptr.hxx> @@ -31,12 +32,19 @@ namespace odb { public: typedef mysql::statement_cache statement_cache_type; - - connection (database&); + typedef mysql::database database_type; virtual ~connection (); + connection (database_type&); + + database_type& + database () + { + return db_; + } + public: MYSQL* handle () @@ -82,8 +90,11 @@ namespace odb free_stmt_handles (); private: + database_type& db_; + MYSQL mysql_; MYSQL* handle_; + statement* active_; std::auto_ptr<statement_cache_type> statement_cache_; |