From 87abcad59a90a9a9ce8809cdf51bea7fc5901baf Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Tue, 5 Jul 2011 12:45:15 +0200 Subject: Add enum support to PostgreSQL --- odb/relational/pgsql/context.cxx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'odb/relational/pgsql/context.cxx') 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 ()) + { + r = "INTEGER"; + + if ((f & ctf_default_null) == 0) + r += " NOT NULL"; + } + + return r; + } + // // SQL type parsing. // -- cgit v1.1