diff options
-rw-r--r-- | odb/relational/pgsql/context.cxx | 24 | ||||
-rw-r--r-- | odb/relational/pgsql/context.hxx | 5 |
2 files changed, 25 insertions, 4 deletions
diff --git a/odb/relational/pgsql/context.cxx b/odb/relational/pgsql/context.cxx index ea18d1f..082800d 100644 --- a/odb/relational/pgsql/context.cxx +++ b/odb/relational/pgsql/context.cxx @@ -210,6 +210,30 @@ namespace relational return r; } + string context:: + database_type_impl (semantics::type& t, + semantics::names* hint, + semantics::context& ctx, + column_type_flags f) + { + string r (base_context::database_type_impl (t, hint, ctx, f)); + + if (!r.empty ()) + return r; + + using semantics::enum_; + + if (t.is_a<semantics::enum_> ()) + { + r = "INTEGER"; + + if ((f & ctf_default_null) == 0) + r += " NOT NULL"; + } + + return r; + } + // // SQL type parsing. // diff --git a/odb/relational/pgsql/context.hxx b/odb/relational/pgsql/context.hxx index 3190bb3..66d9318 100644 --- a/odb/relational/pgsql/context.hxx +++ b/odb/relational/pgsql/context.hxx @@ -88,10 +88,7 @@ namespace relational database_type_impl (semantics::type& t, semantics::names* hint, semantics::context& ctx, - column_type_flags f) - { - return base_context::database_type_impl (t, hint, ctx, f); - } + column_type_flags f); public: virtual |