aboutsummaryrefslogtreecommitdiff
path: root/odb/pgsql/query.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-09-09 12:18:39 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-09-09 12:18:39 +0200
commitdedd9690c67ff5577072162e6a3a5c8a7c843e17 (patch)
treedb6a03a2f1fd90a09bea57d5ae65f7140c4fe126 /odb/pgsql/query.cxx
parent7ce07d1c371e32e474897e8b03da7e330aaefb57 (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/pgsql/query.cxx')
-rw-r--r--odb/pgsql/query.cxx25
1 files changed, 16 insertions, 9 deletions
diff --git a/odb/pgsql/query.cxx b/odb/pgsql/query.cxx
index 856c031..6739b06 100644
--- a/odb/pgsql/query.cxx
+++ b/odb/pgsql/query.cxx
@@ -153,11 +153,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);
@@ -174,7 +172,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::
@@ -250,7 +260,7 @@ namespace odb
}
string query::
- clause (string const& table) const
+ clause () const
{
string r;
size_t param (1);
@@ -267,9 +277,6 @@ namespace odb
if (last != ' ' && last != '(')
r += ' ';
- if (i->part[0] == '.')
- r += table;
-
r += i->part;
break;
}