summaryrefslogtreecommitdiff
path: root/odb/relational/mysql
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-04-25 18:32:22 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-04-25 19:27:36 +0200
commit84d9c3f57c35cf9e99e89eeeb6cc4f1c52c3f5a2 (patch)
tree6467dcafcb98ada1695f27af90ba10966f2dcafb /odb/relational/mysql
parent2f1d254fb49e8cc8bd9ea2137758614e5825eaed (diff)
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.
Diffstat (limited to 'odb/relational/mysql')
-rw-r--r--odb/relational/mysql/context.cxx9
-rw-r--r--odb/relational/mysql/context.hxx2
2 files changed, 7 insertions, 4 deletions
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);