From 382035d872a2cbb22fc14d3c87db93b1f39b407b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 8 Oct 2012 16:09:08 +0200 Subject: Ground work for multi-database support All generated code now includes database id. The database-specific database class interface has been updated to include all the database operations. The database-specific tests now use this interface. --- odb/sqlite/query.txx | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'odb/sqlite/query.txx') diff --git a/odb/sqlite/query.txx b/odb/sqlite/query.txx index ba3fac1..f719ece 100644 --- a/odb/sqlite/query.txx +++ b/odb/sqlite/query.txx @@ -6,12 +6,12 @@ namespace odb { namespace sqlite { - // query + // query_base // template - query:: - query (const query_column& c) + query_base:: + query_base (const query_column& c) : parameters_ (new (details::shared) query_params) { // Cannot use IS TRUE here since database type can be a non- @@ -25,10 +25,10 @@ namespace odb // query_column // template - query query_column:: + query_base query_column:: in (const T& v1, const T& v2) const { - query q (table_, column_); + query_base q (table_, column_); q += "IN ("; q.append (val_bind (v1), conversion_); q += ","; @@ -38,10 +38,10 @@ namespace odb } template - query query_column:: + query_base query_column:: in (const T& v1, const T& v2, const T& v3) const { - query q (table_, column_); + query_base q (table_, column_); q += "IN ("; q.append (val_bind (v1), conversion_); q += ","; @@ -53,10 +53,10 @@ namespace odb } template - query query_column:: + query_base query_column:: in (const T& v1, const T& v2, const T& v3, const T& v4) const { - query q (table_, column_); + query_base q (table_, column_); q += "IN ("; q.append (val_bind (v1), conversion_); q += ","; @@ -70,10 +70,10 @@ namespace odb } template - query query_column:: + query_base query_column:: in (const T& v1, const T& v2, const T& v3, const T& v4, const T& v5) const { - query q (table_, column_); + query_base q (table_, column_); q += "IN ("; q.append (val_bind (v1), conversion_); q += ","; @@ -90,10 +90,10 @@ namespace odb template template - query query_column:: + query_base query_column:: in_range (I begin, I end) const { - query q (table_, column_); + query_base q (table_, column_); q += "IN ("; for (I i (begin); i != end; ++i) @@ -103,6 +103,7 @@ namespace odb q.append (val_bind (*i), conversion_); } + q += ")"; return q; } -- cgit v1.1