From 9ac28a137089fe70dbfcb8a81624e246346d5a1e Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Tue, 7 Jun 2011 18:38:32 +0200 Subject: Make compiler pgsql aware --- odb/generator.cxx | 10 ++++++++++ odb/odb.cxx | 1 + odb/option-functions.cxx | 5 +++++ odb/option-types.cxx | 1 + odb/option-types.hxx | 1 + 5 files changed, 18 insertions(+) diff --git a/odb/generator.cxx b/odb/generator.cxx index 7fa6d6a..f5fa251 100644 --- a/odb/generator.cxx +++ b/odb/generator.cxx @@ -24,6 +24,7 @@ #include #include +#include #include using namespace std; @@ -109,6 +110,11 @@ create_context (ostream& os, semantics::unit& unit, options const& ops) 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)); @@ -278,6 +284,7 @@ generate (options const& ops, semantics::unit& unit, path const& p) switch (ops.database ()) { case database::mysql: + case database::pgsql: case database::sqlite: { relational::header::generate (); @@ -328,6 +335,7 @@ generate (options const& ops, semantics::unit& unit, path const& p) switch (ops.database ()) { case database::mysql: + case database::pgsql: case database::sqlite: { relational::inline_::generate (); @@ -373,6 +381,7 @@ generate (options const& ops, semantics::unit& unit, path const& p) switch (ops.database ()) { case database::mysql: + case database::pgsql: case database::sqlite: { relational::source::generate (); @@ -410,6 +419,7 @@ generate (options const& ops, semantics::unit& unit, path const& p) switch (ops.database ()) { case database::mysql: + case database::pgsql: case database::sqlite: { relational::schema::generate (); diff --git a/odb/odb.cxx b/odb/odb.cxx index 63976db..258d7fa 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_PGSQL", "-DODB_DATABASE_SQLITE", "-DODB_DATABASE_TRACER" }; diff --git a/odb/option-functions.cxx b/odb/option-functions.cxx index 219f718..2f0aa9d 100644 --- a/odb/option-functions.cxx +++ b/odb/option-functions.cxx @@ -25,6 +25,11 @@ process_options (options& o) f.insert (schema_format::sql); break; } + case database::pgsql: + { + f.insert (schema_format::sql); + break; + } case database::sqlite: { f.insert (schema_format::embedded); diff --git a/odb/option-types.cxx b/odb/option-types.cxx index dcac104..849ade7 100644 --- a/odb/option-types.cxx +++ b/odb/option-types.cxx @@ -17,6 +17,7 @@ using namespace std; static const char* database_[] = { "mysql", + "pgsql", "sqlite", "tracer" }; diff --git a/odb/option-types.hxx b/odb/option-types.hxx index 75b3430..6a1a373 100644 --- a/odb/option-types.hxx +++ b/odb/option-types.hxx @@ -15,6 +15,7 @@ struct database // Keep in alphabetic order. // mysql, + pgsql, sqlite, tracer }; -- cgit v1.1