summaryrefslogtreecommitdiff
path: root/odb/context.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-09-13 10:42:46 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-09-13 10:42:46 +0200
commit59e1402abee434c7527744189413892fab336341 (patch)
tree9ccc4a85e9b0a718e4d1e75be217020286e820fd /odb/context.cxx
parentfa6bcd50cec6ad1cc683d3575ff3a3d3d49a3bb5 (diff)
Change pragma syntax
Change odb pragma namespace to db. Use qualifiers (object, value, and member) to specify type/member name. Add support for mapping C++ types to db types.
Diffstat (limited to 'odb/context.cxx')
-rw-r--r--odb/context.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/odb/context.cxx b/odb/context.cxx
index 64d875d..f25409f 100644
--- a/odb/context.cxx
+++ b/odb/context.cxx
@@ -162,7 +162,12 @@ column_type (semantics::data_member& m) const
if (m.count ("type"))
return m.get<string> ("type");
- string const& name (m.type ().fq_name (m.belongs ().hint ()));
+ semantics::type& t (m.type ());
+
+ if (t.count ("type"))
+ return t.get<string> ("type");
+
+ string const& name (t.fq_name (m.belongs ().hint ()));
type_map_type::const_iterator i (data_->type_map_.find (name));
if (i != data_->type_map_.end ())
@@ -173,7 +178,7 @@ column_type (semantics::data_member& m) const
<< "data member '" << m.name () << "' to a database type" << endl;
cerr << m.file () << ":" << m.line () << ":" << m.column () << ":"
- << " info: use '#pragma odb type' to specify the database type"
+ << " info: use '#pragma db type' to specify the database type"
<< endl;
throw generation_failed ();