From 16b43575a7a7bc02a61862ad4c1db5434d3b1d68 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 29 Sep 2011 15:54:45 +0200 Subject: Make ODB Oracle aware --- odb/context.cxx | 10 ++++++++++ odb/generator.cxx | 4 ++++ odb/odb.cxx | 1 + odb/option-functions.cxx | 5 +---- odb/option-types.cxx | 1 + odb/option-types.hxx | 1 + odb/options.cli | 2 +- 7 files changed, 19 insertions(+), 5 deletions(-) diff --git a/odb/context.cxx b/odb/context.cxx index 7919e39..0ca6157 100644 --- a/odb/context.cxx +++ b/odb/context.cxx @@ -10,6 +10,9 @@ #include #include +// @@ Uncomment once implemented. +// +// #include #include #include @@ -109,6 +112,13 @@ create_context (ostream& os, semantics::unit& unit, options const& ops) r.reset (new relational::mysql::context (os, unit, ops)); break; } + case database::oracle: + { + // @@ Uncomment once implemented. + // + // r.reset (new relational::oracle::context (os, unit, ops)); + break; + } case database::pgsql: { r.reset (new relational::pgsql::context (os, unit, ops)); diff --git a/odb/generator.cxx b/odb/generator.cxx index 683834c..aa56644 100644 --- a/odb/generator.cxx +++ b/odb/generator.cxx @@ -234,6 +234,7 @@ generate (options const& ops, semantics::unit& unit, path const& p) switch (ops.database ()) { case database::mysql: + case database::oracle: case database::pgsql: case database::sqlite: { @@ -285,6 +286,7 @@ generate (options const& ops, semantics::unit& unit, path const& p) switch (ops.database ()) { case database::mysql: + case database::oracle: case database::pgsql: case database::sqlite: { @@ -331,6 +333,7 @@ generate (options const& ops, semantics::unit& unit, path const& p) switch (ops.database ()) { case database::mysql: + case database::oracle: case database::pgsql: case database::sqlite: { @@ -369,6 +372,7 @@ generate (options const& ops, semantics::unit& unit, path const& p) switch (ops.database ()) { case database::mysql: + case database::oracle: case database::pgsql: case database::sqlite: { diff --git a/odb/odb.cxx b/odb/odb.cxx index a4376b5..51c14f4 100644 --- a/odb/odb.cxx +++ b/odb/odb.cxx @@ -121,6 +121,7 @@ profile_paths (strings const& args, char const* name); static char const* const db_macro[] = { "-DODB_DATABASE_MYSQL", + "-DODB_DATABASE_ORACLE", "-DODB_DATABASE_PGSQL", "-DODB_DATABASE_SQLITE", "-DODB_DATABASE_TRACER" diff --git a/odb/option-functions.cxx b/odb/option-functions.cxx index 2f0aa9d..bd4ec09 100644 --- a/odb/option-functions.cxx +++ b/odb/option-functions.cxx @@ -21,10 +21,7 @@ process_options (options& o) switch (o.database ()) { case database::mysql: - { - f.insert (schema_format::sql); - break; - } + case database::oracle: case database::pgsql: { f.insert (schema_format::sql); diff --git a/odb/option-types.cxx b/odb/option-types.cxx index 849ade7..da29793 100644 --- a/odb/option-types.cxx +++ b/odb/option-types.cxx @@ -17,6 +17,7 @@ using namespace std; static const char* database_[] = { "mysql", + "oracle", "pgsql", "sqlite", "tracer" diff --git a/odb/option-types.hxx b/odb/option-types.hxx index 6a1a373..966f5cf 100644 --- a/odb/option-types.hxx +++ b/odb/option-types.hxx @@ -15,6 +15,7 @@ struct database // Keep in alphabetic order. // mysql, + oracle, pgsql, sqlite, tracer diff --git a/odb/options.cli b/odb/options.cli index f8c50b4..d837418 100644 --- a/odb/options.cli +++ b/odb/options.cli @@ -49,7 +49,7 @@ class options { "", "Generate code for the database. Valid values are \cb{mysql}, - \cb{pgsql}, \cb{sqlite}, and \cb{tracer}." + \cb{oracle}, \cb{pgsql}, \cb{sqlite}, and \cb{tracer}." }; bool --generate-query | -q -- cgit v1.1