diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-09-09 12:18:38 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-09-09 12:18:38 +0200 |
commit | 0a7c90251190205e8bd9f5193b7402e25efa2f81 (patch) | |
tree | 84d91a66ef37105c082c4154fbf3fca37c11e98b /odb/mysql/query.txx | |
parent | 932ae000f66ec5935c368b953da24dfd6cf7581b (diff) |
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.
Diffstat (limited to 'odb/mysql/query.txx')
-rw-r--r-- | odb/mysql/query.txx | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/odb/mysql/query.txx b/odb/mysql/query.txx index 6addb65..c28155d 100644 --- a/odb/mysql/query.txx +++ b/odb/mysql/query.txx @@ -15,12 +15,11 @@ namespace odb query (const query_column<bool, ID>& c) : binding_ (0, 0) { - 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<bool, ID> (val_bind<bool> (true)); } @@ -30,7 +29,7 @@ namespace odb query query_column<T, ID>:: in (const T& v1, const T& v2) const { - query q (name_, query::clause_part::column); + query q (table_, column_); q += "IN ("; q.append<T, ID> (val_bind<T> (v1)); q += ","; @@ -43,7 +42,7 @@ namespace odb query query_column<T, ID>:: 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<T, ID> (val_bind<T> (v1)); q += ","; @@ -58,7 +57,7 @@ namespace odb query query_column<T, ID>:: 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<T, ID> (val_bind<T> (v1)); q += ","; @@ -75,7 +74,7 @@ namespace odb query query_column<T, ID>:: 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<T, ID> (val_bind<T> (v1)); q += ","; @@ -95,7 +94,7 @@ namespace odb query query_column<T, ID>:: 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) |