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.cxx | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'odb/sqlite/query.cxx') diff --git a/odb/sqlite/query.cxx b/odb/sqlite/query.cxx index 4a2082b..ab158bb 100644 --- a/odb/sqlite/query.cxx +++ b/odb/sqlite/query.cxx @@ -156,11 +156,9 @@ namespace odb } void query:: - append (const string& q, clause_part::kind_type k) + append (const string& q) { - if (k == clause_part::native && - !clause_.empty () && - clause_.back ().kind == clause_part::native) + if (!clause_.empty () && clause_.back ().kind == clause_part::native) { string& s (clause_.back ().part); @@ -177,7 +175,19 @@ namespace odb s += q; } else - clause_.push_back (clause_part (k, q)); + clause_.push_back (clause_part (clause_part::native, q)); + } + + void query:: + append (const char* table, const char* column) + { + string s ("\""); + s += table; + s += "\".\""; + s += column; + s += '"'; + + clause_.push_back (clause_part (clause_part::column, s)); } void query:: @@ -188,7 +198,7 @@ namespace odb } string query:: - clause (string const& table) const + clause () const { string r; @@ -204,9 +214,6 @@ namespace odb if (last != ' ' && last != '(') r += ' '; - if (i->part[0] == '.') - r += table; - r += i->part; break; } -- cgit v1.1