aboutsummaryrefslogtreecommitdiff
path: root/odb/mysql/query.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-10-08 16:09:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-10-08 16:09:07 +0200
commitc0af27a770b1505ad6a1226f57f90642ce395296 (patch)
tree21fa70b3fa49c639cef4d5f07b73815291e3be1c /odb/mysql/query.cxx
parent46b2db37445b97cd3dbb8acd4f417e0851a30e4f (diff)
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.
Diffstat (limited to 'odb/mysql/query.cxx')
-rw-r--r--odb/mysql/query.cxx46
1 files changed, 23 insertions, 23 deletions
diff --git a/odb/mysql/query.cxx b/odb/mysql/query.cxx
index ac710d8..bc0c4f0 100644
--- a/odb/mysql/query.cxx
+++ b/odb/mysql/query.cxx
@@ -20,10 +20,10 @@ namespace odb
{
}
- // query
+ // query_base
//
- query::
- query (const query& q)
+ query_base::
+ query_base (const query_base& q)
: clause_ (q.clause_),
parameters_ (q.parameters_),
bind_ (q.bind_),
@@ -43,8 +43,8 @@ namespace odb
}
}
- query& query::
- operator= (const query& q)
+ query_base& query_base::
+ operator= (const query_base& q)
{
if (this != &q)
{
@@ -61,8 +61,8 @@ namespace odb
return *this;
}
- query& query::
- operator+= (const query& q)
+ query_base& query_base::
+ operator+= (const query_base& q)
{
clause_.insert (clause_.end (), q.clause_.begin (), q.clause_.end ());
@@ -84,7 +84,7 @@ namespace odb
return *this;
}
- void query::
+ void query_base::
append (const string& q)
{
if (!clause_.empty () && clause_.back ().kind == clause_part::native)
@@ -107,7 +107,7 @@ namespace odb
clause_.push_back (clause_part (clause_part::native, q));
}
- void query::
+ void query_base::
append (const char* table, const char* column)
{
string s (table);
@@ -117,7 +117,7 @@ namespace odb
clause_.push_back (clause_part (clause_part::column, s));
}
- void query::
+ void query_base::
add (details::shared_ptr<query_param> p, const char* conv)
{
clause_.push_back (clause_part (clause_part::param));
@@ -136,7 +136,7 @@ namespace odb
p->bind (b);
}
- binding& query::
+ binding& query_base::
parameters_binding () const
{
size_t n (parameters_.size ());
@@ -198,7 +198,7 @@ namespace odb
return false;
}
- void query::
+ void query_base::
optimize ()
{
// Remove a single TRUE literal or one that is followe by one of
@@ -218,7 +218,7 @@ namespace odb
}
}
- const char* query::
+ const char* query_base::
clause_prefix () const
{
if (!clause_.empty ())
@@ -234,7 +234,7 @@ namespace odb
return "";
}
- string query::
+ string query_base::
clause () const
{
string r;
@@ -306,8 +306,8 @@ namespace odb
return clause_prefix () + r;
}
- query
- operator&& (const query& x, const query& y)
+ query_base
+ operator&& (const query_base& x, const query_base& y)
{
// Optimize cases where one or both sides are constant truth.
//
@@ -322,7 +322,7 @@ namespace odb
if (yt)
return x;
- query r ("(");
+ query_base r ("(");
r += x;
r += ") AND (";
r += y;
@@ -330,10 +330,10 @@ namespace odb
return r;
}
- query
- operator|| (const query& x, const query& y)
+ query_base
+ operator|| (const query_base& x, const query_base& y)
{
- query r ("(");
+ query_base r ("(");
r += x;
r += ") OR (";
r += y;
@@ -341,10 +341,10 @@ namespace odb
return r;
}
- query
- operator! (const query& x)
+ query_base
+ operator! (const query_base& x)
{
- query r ("NOT (");
+ query_base r ("NOT (");
r += x;
r += ")";
return r;