From a8b1a89c291ab5bd170568eab3d7666631adf035 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 9 Sep 2011 12:18:39 +0200 Subject: New templated query_columns architecture We also now use the correct separate "role"-base join approach instead of having a single merged join for each table. --- odb/sqlite/query.txx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'odb/sqlite/query.txx') diff --git a/odb/sqlite/query.txx b/odb/sqlite/query.txx index 6af80e7..590d4bd 100644 --- a/odb/sqlite/query.txx +++ b/odb/sqlite/query.txx @@ -15,12 +15,11 @@ namespace odb query (const query_column& c) : parameters_ (new (details::shared) query_params) { - clause_.push_back (clause_part (clause_part::column, c.name ())); - // Cannot use IS TRUE here since database type can be a non- // integral type. // - clause_.push_back (clause_part (clause_part::native, "=")); + append (c.table (), c.column ()); + append ("="); append (val_bind (true)); } @@ -30,7 +29,7 @@ namespace odb query query_column:: in (const T& v1, const T& v2) const { - query q (name_, query::clause_part::column); + query q (table_, column_); q += "IN ("; q.append (val_bind (v1)); q += ","; @@ -43,7 +42,7 @@ namespace odb query query_column:: in (const T& v1, const T& v2, const T& v3) const { - query q (name_, query::clause_part::column); + query q (table_, column_); q += "IN ("; q.append (val_bind (v1)); q += ","; @@ -58,7 +57,7 @@ namespace odb query query_column:: in (const T& v1, const T& v2, const T& v3, const T& v4) const { - query q (name_, query::clause_part::column); + query q (table_, column_); q += "IN ("; q.append (val_bind (v1)); q += ","; @@ -75,7 +74,7 @@ namespace odb query query_column:: in (const T& v1, const T& v2, const T& v3, const T& v4, const T& v5) const { - query q (name_, query::clause_part::column); + query q (table_, column_); q += "IN ("; q.append (val_bind (v1)); q += ","; @@ -95,7 +94,7 @@ namespace odb query query_column:: in_range (I begin, I end) const { - query q (name_, query::clause_part::column); + query q (table_, column_); q += "IN ("; for (I i (begin); i != end; ++i) -- cgit v1.1