diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-09-19 16:19:25 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-09-19 16:19:25 +0200 |
commit | 55df757e98329e8e09afffe274ce2ceab269f8b3 (patch) | |
tree | 738b3a5b1c46e3b1b04184cfd9aeb32eb21af48a /odb/context.cxx | |
parent | 6c01cad9cbfb6e69121d106226b2c50026f86fa9 (diff) |
Make processing top-level action, like validation and generation
Diffstat (limited to 'odb/context.cxx')
-rw-r--r-- | odb/context.cxx | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/odb/context.cxx b/odb/context.cxx index e679a55..7919e39 100644 --- a/odb/context.cxx +++ b/odb/context.cxx @@ -9,6 +9,10 @@ #include <odb/context.hxx> #include <odb/common.hxx> +#include <odb/relational/mysql/context.hxx> +#include <odb/relational/pgsql/context.hxx> +#include <odb/relational/sqlite/context.hxx> + using namespace std; namespace @@ -93,6 +97,38 @@ namespace }; } +auto_ptr<context> +create_context (ostream& os, semantics::unit& unit, options const& ops) +{ + auto_ptr<context> r; + + switch (ops.database ()) + { + case database::mysql: + { + r.reset (new relational::mysql::context (os, unit, ops)); + break; + } + case database::pgsql: + { + r.reset (new relational::pgsql::context (os, unit, ops)); + break; + } + case database::sqlite: + { + r.reset (new relational::sqlite::context (os, unit, ops)); + break; + } + case database::tracer: + { + r.reset (new context (os, unit, ops)); + break; + } + } + + return r; +} + context:: ~context () { |