From 84d9c3f57c35cf9e99e89eeeb6cc4f1c52c3f5a2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 25 Apr 2011 18:32:22 +0200 Subject: Add support for mapping to database types based on type aliases This allows us to, for example, always map size_t to 64-bit type. The current implementation does not work for containers. It is not clear whether it will be possible to make it work using the GCC AST. --- odb/relational/mysql/context.cxx | 9 ++++++--- odb/relational/mysql/context.hxx | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'odb/relational/mysql') diff --git a/odb/relational/mysql/context.cxx b/odb/relational/mysql/context.cxx index 4e31361..aa47b78 100644 --- a/odb/relational/mysql/context.cxx +++ b/odb/relational/mysql/context.cxx @@ -50,7 +50,10 @@ namespace relational {"float", "FLOAT", 0}, {"double", "DOUBLE", 0}, - {"::std::string", "TEXT", "VARCHAR (255)"} + {"::std::string", "TEXT", "VARCHAR (255)"}, + + {"::size_t", "BIGINT UNSIGNED", 0}, + {"::std::size_t", "BIGINT UNSIGNED", 0} }; } @@ -232,11 +235,11 @@ namespace relational string context:: database_type_impl (semantics::type& t, - string const& type, + semantics::names* hint, semantics::context& ctx, column_type_flags f) { - string r (base_context::database_type_impl (t, type, ctx, f)); + string r (base_context::database_type_impl (t, hint, ctx, f)); if (!r.empty ()) return r; diff --git a/odb/relational/mysql/context.hxx b/odb/relational/mysql/context.hxx index cada5d9..019b878 100644 --- a/odb/relational/mysql/context.hxx +++ b/odb/relational/mysql/context.hxx @@ -98,7 +98,7 @@ namespace relational protected: virtual string database_type_impl (semantics::type&, - string const& type, + semantics::names*, semantics::context&, column_type_flags); -- cgit v1.1