summaryrefslogtreecommitdiff
path: root/odb/relational/context.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-01-26 12:43:16 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-01-26 12:43:16 +0200
commitaf12ffe836de09ec84f666effa4df347eeb07a43 (patch)
treedc0aec9f8fee545c84be098414772cf2b277c30d /odb/relational/context.cxx
parentc1d2ec5bbd5969332f3278f39d2a7a8f0abc0493 (diff)
Implement support for database schema
New pragma qualifier: namespace. New pragma specifier: schema. The table specifier was extended to accept a schema prefix. New option: --default- schema. The common/schema test was extended to cover the new functionality.
Diffstat (limited to 'odb/relational/context.cxx')
-rw-r--r--odb/relational/context.cxx23
1 files changed, 18 insertions, 5 deletions
diff --git a/odb/relational/context.cxx b/odb/relational/context.cxx
index 0ebfbf4..083bfe5 100644
--- a/odb/relational/context.cxx
+++ b/odb/relational/context.cxx
@@ -83,13 +83,26 @@ namespace relational
}
string context::
- quote_id_impl (string const& id) const
+ quote_id_impl (qname const& id) const
{
string r;
- r.reserve (id.size () + 2);
- r += '"';
- r += id;
- r += '"';
+
+ bool f (true);
+ for (qname::iterator i (id.begin ()); i < id.end (); ++i)
+ {
+ if (i->empty ())
+ continue;
+
+ if (f)
+ f = false;
+ else
+ r += '.';
+
+ r += '"';
+ r += *i;
+ r += '"';
+ }
+
return r;
}
}