aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-05-11 09:08:22 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-05-11 09:27:47 +0200
commitfd0eb17d25ee829557549255ec64f9b9b063ec8b (patch)
tree279c36bda3559b908d99f7ab87dbd192c57b4a29
parentf26337fb02c2f01382486407c2b3d7432df9bd37 (diff)
Uncomment calls to connection and connection-factory interface
-rw-r--r--odb/pgsql/database.cxx33
-rw-r--r--odb/pgsql/database.hxx10
-rw-r--r--odb/pgsql/database.ixx12
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 <odb/pgsql/database.hxx>
#include <odb/pgsql/exceptions.hxx>
+#include <odb/pgsql/connection-factory.hxx>
#include <odb/pgsql/details/options.hxx>
@@ -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<connection_factory> 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 <odb/pgsql/version.hxx>
#include <odb/pgsql/forward.hxx>
+#include <odb/pgsql/connection-factory.hxx>
#include <odb/pgsql/details/export.hxx>
@@ -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_type>
- // connection ();
+ details::shared_ptr<connection_type>
+ 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_type> database::
- // connection ()
- // {
- // return factory_->connect ();
- // }
+ inline details::shared_ptr<database::connection_type> database::
+ connection ()
+ {
+ return factory_->connect ();
+ }
}
}