From d1ad30f7a517e69bc87d1347224f1c9ab38493b3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 25 Oct 2012 10:35:36 +0200 Subject: Static multi-database support Add new options (--multi-database, --default-database). Generate common code to -odb.?xx files and database-specific to -odb-.?xx. --- odb/context.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'odb/context.cxx') diff --git a/odb/context.cxx b/odb/context.cxx index 099b10b..2350ad1 100644 --- a/odb/context.cxx +++ b/odb/context.cxx @@ -386,8 +386,13 @@ create_context (ostream& os, { auto_ptr r; - switch (ops.database ()) + switch (ops.database ()[0]) { + case database::common: + { + r.reset (new context (os, unit, ops, f)); + break; + } case database::mssql: { r.reset (new relational::mssql::context (os, unit, ops, f, m)); @@ -436,7 +441,7 @@ context (ostream& os_, unit (u), options (ops), features (f), - db (options.database ()), + db (options.database ()[0]), keyword_set (data_->keyword_set_), include_regex (data_->include_regex_), accessor_regex (data_->accessor_regex_), -- cgit v1.1