diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-01-26 12:43:16 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-01-26 12:43:16 +0200 |
commit | af12ffe836de09ec84f666effa4df347eeb07a43 (patch) | |
tree | dc0aec9f8fee545c84be098414772cf2b277c30d /odb/relational/header.hxx | |
parent | c1d2ec5bbd5969332f3278f39d2a7a8f0abc0493 (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/header.hxx')
-rw-r--r-- | odb/relational/header.hxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/odb/relational/header.hxx b/odb/relational/header.hxx index 427b008..b358810 100644 --- a/odb/relational/header.hxx +++ b/odb/relational/header.hxx @@ -1407,11 +1407,12 @@ namespace relational semantics::class_& o (*i->obj); string const& name (alias ? i->alias : class_name (o)); string const& type (class_fq_name (o)); + qname const& table (table_name (o)); os << "// " << name << endl << "//" << endl; - if (alias && i->alias != table_name (o)) + if (alias && (table.qualified () || i->alias != table.uname ())) os << "static const char " << name << "_alias_[];" << endl << "typedef" << endl @@ -1450,8 +1451,9 @@ namespace relational bool alias (!vo->alias.empty ()); semantics::class_& o (*vo->obj); string const& type (class_fq_name (o)); + qname const& table (table_name (o)); - if (alias && vo->alias != table_name (o)) + if (alias && (table.qualified () || vo->alias != table.uname ())) os << "static const char query_alias[];" << endl << "struct query_type:" << endl |