summaryrefslogtreecommitdiff
path: root/odb/generator.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-03-01 11:56:33 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-03-01 11:56:33 +0200
commitfe69d94f3d2dcb37d69ac2d7a0f88ad5fce2ad5c (patch)
treed93f7ea21f66e9fe416c48766b99f987ad7b3804 /odb/generator.cxx
parent6c97eb68924e7f9ea5b0d859182562ec8f812a1e (diff)
Add support for embedded database schemas
New options: --schema-format, --default-schema. New example: schema/embedded.
Diffstat (limited to 'odb/generator.cxx')
-rw-r--r--odb/generator.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/odb/generator.cxx b/odb/generator.cxx
index ddeda2b..91548e4 100644
--- a/odb/generator.cxx
+++ b/odb/generator.cxx
@@ -29,10 +29,10 @@
#include <odb/tracer/source.hxx>
#include <odb/mysql/context.hxx>
-#include <odb/mysql/schema.hxx>
#include <odb/mysql/header.hxx>
#include <odb/mysql/inline.hxx>
#include <odb/mysql/source.hxx>
+#include <odb/mysql/sql-schema.hxx>
using namespace std;
using namespace cutl;
@@ -201,9 +201,11 @@ generate (options const& ops, semantics::unit& unit, path const& p)
//
//
+ bool sql_schema (ops.generate_schema () &&
+ ops.schema_format ().count (schema_format::sql));
ofstream sql;
- if (ops.generate_schema ())
+ if (sql_schema)
{
sql.open (sql_path.string ().c_str (), ios_base::out);
@@ -429,7 +431,7 @@ generate (options const& ops, semantics::unit& unit, path const& p)
// SQL
//
- if (ops.generate_schema ())
+ if (sql_schema)
{
// Copy prologue.
//