aboutsummaryrefslogtreecommitdiff
path: root/pgsql
diff options
context:
space:
mode:
Diffstat (limited to 'pgsql')
-rw-r--r--pgsql/custom/driver.cxx7
-rw-r--r--pgsql/custom/query.hxx34
-rw-r--r--pgsql/database/driver.cxx3
-rw-r--r--pgsql/index/driver.cxx7
-rw-r--r--pgsql/native/driver.cxx6
-rw-r--r--pgsql/template/driver.cxx5
-rw-r--r--pgsql/truncation/driver.cxx9
-rw-r--r--pgsql/types/driver.cxx5
8 files changed, 42 insertions, 34 deletions
diff --git a/pgsql/custom/driver.cxx b/pgsql/custom/driver.cxx
index f1f70f8..7188f74 100644
--- a/pgsql/custom/driver.cxx
+++ b/pgsql/custom/driver.cxx
@@ -18,14 +18,15 @@
#include "test-odb.hxx"
using namespace std;
-using namespace odb::core;
+namespace pgsql = odb::pgsql;
+using namespace pgsql;
int
main (int argc, char* argv[])
{
try
{
- auto_ptr<database> db (create_database (argc, argv));
+ auto_ptr<database> db (create_specific_database<database> (argc, argv));
object o (1);
o.p = point (1.1111, 2222222222.2);
@@ -61,7 +62,7 @@ main (int argc, char* argv[])
// Query.
//
- typedef odb::query<object> query;
+ typedef pgsql::query<object> query;
typedef odb::result<object> result;
{
diff --git a/pgsql/custom/query.hxx b/pgsql/custom/query.hxx
index 4b29b45..432d25b 100644
--- a/pgsql/custom/query.hxx
+++ b/pgsql/custom/query.hxx
@@ -34,18 +34,18 @@ namespace odb
// is_null, is_not_null
//
public:
- query
+ query_base
is_null () const
{
- query q (table_, column_);
+ query_base q (table_, column_);
q += "IS NULL";
return q;
}
- query
+ query_base
is_not_null () const
{
- query q (table_, column_);
+ query_base q (table_, column_);
q += "IS NOT NULL";
return q;
}
@@ -53,61 +53,61 @@ namespace odb
// =
//
public:
- query
+ query_base
equal (const point& v) const
{
return equal (val_bind<point> (v));
}
- query
+ query_base
equal (val_bind<point> v) const
{
- query q (table_, column_);
+ query_base q (table_, column_);
q += "~=";
q.append<point, id_string> (v, conversion_);
return q;
}
- query
+ query_base
equal (ref_bind<point> r) const
{
- query q (table_, column_);
+ query_base q (table_, column_);
q += "~=";
q.append<point, id_string> (r, conversion_);
return q;
}
- friend query
+ friend query_base
operator== (const query_column& c, const point& v)
{
return c.equal (v);
}
- friend query
+ friend query_base
operator== (const point& v, const query_column& c)
{
return c.equal (v);
}
- friend query
+ friend query_base
operator== (const query_column& c, val_bind<point> v)
{
return c.equal (v);
}
- friend query
+ friend query_base
operator== (val_bind<point> v, const query_column& c)
{
return c.equal (v);
}
- friend query
+ friend query_base
operator== (const query_column& c, ref_bind<point> r)
{
return c.equal (r);
}
- friend query
+ friend query_base
operator== (ref_bind<point> r, const query_column& c)
{
return c.equal (r);
@@ -116,10 +116,10 @@ namespace odb
// Column comparison.
//
public:
- query
+ query_base
operator== (const query_column<point, id_string>& c) const
{
- query q (table_, column_);
+ query_base q (table_, column_);
q += "~=";
q.append (c.table (), c.column ());
return q;
diff --git a/pgsql/database/driver.cxx b/pgsql/database/driver.cxx
index 8746c37..68c34ab 100644
--- a/pgsql/database/driver.cxx
+++ b/pgsql/database/driver.cxx
@@ -7,7 +7,8 @@
#include <odb/pgsql/database.hxx>
-using namespace odb::pgsql;
+namespace pgsql = odb::pgsql;
+using namespace pgsql;
int
main (int argc, char* argv[])
diff --git a/pgsql/index/driver.cxx b/pgsql/index/driver.cxx
index 48ac5f8..4c46b58 100644
--- a/pgsql/index/driver.cxx
+++ b/pgsql/index/driver.cxx
@@ -1,4 +1,4 @@
-// file : pgsql/template/driver.cxx
+// file : pgsql/index/driver.cxx
// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC
// license : GNU GPL v2; see accompanying LICENSE file
@@ -18,7 +18,8 @@
#include "test-odb.hxx"
using namespace std;
-using namespace odb::core;
+namespace pgsql = odb::pgsql;
+using namespace pgsql;
int
main (int argc, char* argv[])
@@ -27,7 +28,7 @@ main (int argc, char* argv[])
{
// This is just a schema creation test.
//
- auto_ptr<database> db (create_database (argc, argv));
+ auto_ptr<database> db (create_specific_database<database> (argc, argv));
{
transaction t (db->begin ());
diff --git a/pgsql/native/driver.cxx b/pgsql/native/driver.cxx
index 94bda60..3e4b680 100644
--- a/pgsql/native/driver.cxx
+++ b/pgsql/native/driver.cxx
@@ -10,18 +10,20 @@
#include <iostream>
#include <odb/pgsql/database.hxx>
+#include <odb/pgsql/transaction.hxx>
#include <common/common.hxx>
using namespace std;
-using namespace odb::core;
+namespace pgsql = odb::pgsql;
+using namespace pgsql;
int
main (int argc, char* argv[])
{
try
{
- auto_ptr<database> db (create_database (argc, argv));
+ auto_ptr<database> db (create_specific_database<database> (argc, argv));
// Create the database schema.
//
diff --git a/pgsql/template/driver.cxx b/pgsql/template/driver.cxx
index 329c91c..9297ab0 100644
--- a/pgsql/template/driver.cxx
+++ b/pgsql/template/driver.cxx
@@ -18,14 +18,15 @@
#include "test-odb.hxx"
using namespace std;
-using namespace odb::core;
+namespace pgsql = odb::pgsql;
+using namespace pgsql;
int
main (int argc, char* argv[])
{
try
{
- auto_ptr<database> db (create_database (argc, argv));
+ auto_ptr<database> db (create_specific_database<database> (argc, argv));
//
//
diff --git a/pgsql/truncation/driver.cxx b/pgsql/truncation/driver.cxx
index eefbdcd..fe72780 100644
--- a/pgsql/truncation/driver.cxx
+++ b/pgsql/truncation/driver.cxx
@@ -18,7 +18,8 @@
#include "test-odb.hxx"
using namespace std;
-using namespace odb::core;
+namespace pgsql = odb::pgsql;
+using namespace pgsql;
int
main (int argc, char* argv[])
@@ -33,7 +34,7 @@ main (int argc, char* argv[])
// Test basic operations.
//
{
- auto_ptr<database> db (create_database (argc, argv));
+ auto_ptr<database> db (create_specific_database<database> (argc, argv));
// Run persist/load so that the initial bindings are established
// (version == 0).
@@ -98,10 +99,10 @@ main (int argc, char* argv[])
// Test query.
//
{
- typedef odb::query<object1> query;
+ typedef pgsql::query<object1> query;
typedef odb::result<object1> result;
- auto_ptr<database> db (create_database (argc, argv));
+ auto_ptr<database> db (create_specific_database<database> (argc, argv));
// Run persist/query so that the initial bindings are established
// (version == 0).
diff --git a/pgsql/types/driver.cxx b/pgsql/types/driver.cxx
index 8b51cc5..8b969aa 100644
--- a/pgsql/types/driver.cxx
+++ b/pgsql/types/driver.cxx
@@ -18,14 +18,15 @@
#include "test-odb.hxx"
using namespace std;
-using namespace odb::core;
+namespace pgsql = odb::pgsql;
+using namespace pgsql;
int
main (int argc, char* argv[])
{
try
{
- auto_ptr<database> db (create_database (argc, argv));
+ auto_ptr<database> db (create_specific_database<database> (argc, argv));
object o (1);