From fd0eb17d25ee829557549255ec64f9b9b063ec8b Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Wed, 11 May 2011 09:08:22 +0200 Subject: Uncomment calls to connection and connection-factory interface --- odb/pgsql/database.cxx | 33 +++++++++++++-------------------- odb/pgsql/database.hxx | 10 ++++++---- odb/pgsql/database.ixx | 12 +++++------- 3 files changed, 24 insertions(+), 31 deletions(-) diff --git a/odb/pgsql/database.cxx b/odb/pgsql/database.cxx index 22468a4..887061b 100644 --- a/odb/pgsql/database.cxx +++ b/odb/pgsql/database.cxx @@ -7,6 +7,7 @@ #include #include +#include #include @@ -57,12 +58,10 @@ namespace odb conninfo_ = ss.str (); - // @@ Uncomment once factory has been implemented. - // - // if (factory_.get () == 0) - // factory_.reset (new connection_pool_factory ()); + if (factory_.get () == 0) + factory_.reset (new connection_pool_factory ()); - // factory_->database (*this); + factory_->database (*this); } database:: @@ -107,12 +106,10 @@ namespace odb conninfo_ = ss.str (); - // @@ Uncomment once factory has been implemented. - // - // if (factory_.get () == 0) - // factory_.reset (new connection_pool_factory ()); + if (factory_.get () == 0) + factory_.reset (new connection_pool_factory ()); - // factory_->database (*this); + factory_->database (*this); } database:: @@ -120,12 +117,10 @@ namespace odb auto_ptr factory) : port_ (0), conninfo_ (conninfo), factory_ (factory) { - // @@ Uncomment once factory has been implemented. - // - // if (factory_.get () == 0) - // factory_.reset (new connection_pool_factory ()); + if (factory_.get () == 0) + factory_.reset (new connection_pool_factory ()); - // factory_->database (*this); + factory_->database (*this); } database:: @@ -195,12 +190,10 @@ namespace odb throw cli_exception (oss.str ()); } - // @@ Uncomment once factory has been implemented. - // - // if (factory_.get () == 0) - // factory_.reset (new connection_pool_factory ()); + if (factory_.get () == 0) + factory_.reset (new connection_pool_factory ()); - // factory_->database (*this); + factory_->database (*this); } void database:: diff --git a/odb/pgsql/database.hxx b/odb/pgsql/database.hxx index fbd15b9..833e472 100644 --- a/odb/pgsql/database.hxx +++ b/odb/pgsql/database.hxx @@ -16,6 +16,7 @@ #include #include +#include #include @@ -26,6 +27,9 @@ namespace odb class LIBODB_PGSQL_EXPORT database: public odb::database { public: + typedef pgsql::connection connection_type; + + public: database (const std::string& db, const std::string& user, const std::string& password, @@ -88,10 +92,8 @@ namespace odb // begin (); public: - // @@ Implement on completion of supporting code. - // - // details::shared_ptr - // connection (); + details::shared_ptr + connection (); public: virtual diff --git a/odb/pgsql/database.ixx b/odb/pgsql/database.ixx index 04fcb16..a4f5040 100644 --- a/odb/pgsql/database.ixx +++ b/odb/pgsql/database.ixx @@ -7,12 +7,10 @@ namespace odb { namespace pgsql { - // @@ Implement on completion of supporting code. - // - // inline details::shared_ptr database:: - // connection () - // { - // return factory_->connect (); - // } + inline details::shared_ptr database:: + connection () + { + return factory_->connect (); + } } } -- cgit v1.1