diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-01-24 15:10:22 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-01-24 15:10:22 +0200 |
commit | ce03afff5ef2e8da677def73079864c31c6618d8 (patch) | |
tree | f0dd5ace26fcfb5c16dee9930a70cf274a80cfc0 /odb/context.cxx | |
parent | 7c9d4543838490670b632c7049bea53d58d78487 (diff) |
Add support for mapping char[N] to CHAR/VARCHAR database types
Also improve query support for arrays (decaying).
Diffstat (limited to 'odb/context.cxx')
-rw-r--r-- | odb/context.cxx | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/odb/context.cxx b/odb/context.cxx index 46116f6..515e9a8 100644 --- a/odb/context.cxx +++ b/odb/context.cxx @@ -720,13 +720,6 @@ null (semantics::data_member& m) const } else pt = &t; - - // See if this is one of the types with built-in mapping. - // - type_map_type::const_iterator i (data_->type_map_.find (*pt, hint)); - - if (i != data_->type_map_.end ()) - return i->second.null; } } @@ -811,13 +804,6 @@ null (semantics::data_member& m, string const& kp) const } else pt = &t; - - // See if this is one of the types with built-in mapping. - // - type_map_type::const_iterator i (data_->type_map_.find (*pt, hint)); - - if (i != data_->type_map_.end ()) - return i->second.null; } } } @@ -1749,12 +1735,19 @@ find (semantics::type& t, semantics::names* hint) } string context:: -database_type_impl (semantics::type& t, semantics::names* hint, bool id) +database_type_impl (semantics::type& t, + semantics::names* hint, + bool id, + bool* null) { type_map_type::const_iterator i (data_->type_map_.find (t, hint)); if (i != data_->type_map_.end ()) + { + if (null != 0) + *null = i->second.null; return id ? i->second.id_type : i->second.type; + } else return string (); } |