diff options
Diffstat (limited to 'odb/relational/sqlite')
-rw-r--r-- | odb/relational/sqlite/context.cxx | 24 | ||||
-rw-r--r-- | odb/relational/sqlite/context.hxx | 6 |
2 files changed, 30 insertions, 0 deletions
diff --git a/odb/relational/sqlite/context.cxx b/odb/relational/sqlite/context.cxx index 7803298..b2b3033 100644 --- a/odb/relational/sqlite/context.cxx +++ b/odb/relational/sqlite/context.cxx @@ -196,6 +196,30 @@ namespace relational return r; } + string context:: + database_type_impl (semantics::type& t, + string const& type, + semantics::context& ctx, + column_type_flags f) + { + string r (base_context::database_type_impl (t, type, 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/sqlite/context.hxx b/odb/relational/sqlite/context.hxx index 1aa18af..621c549 100644 --- a/odb/relational/sqlite/context.hxx +++ b/odb/relational/sqlite/context.hxx @@ -47,6 +47,12 @@ namespace relational virtual bool grow_impl (semantics::data_member&, semantics::type&, string const&); + protected: + virtual string + database_type_impl (semantics::type&, + string const& type, + semantics::context&, + column_type_flags); public: virtual ~context (); |