From 3d1969a43fce72dd50044c5eada38557f3f200bd Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 8 Oct 2012 16:09:08 +0200 Subject: Ground work for multi-database support All generated code now includes database id. The database-specific database class interface has been updated to include all the database operations. The database-specific tests now use this interface. --- sqlite/custom/driver.cxx | 5 +++-- sqlite/database/driver.cxx | 3 ++- sqlite/native/driver.cxx | 6 ++++-- sqlite/template/driver.cxx | 5 +++-- sqlite/truncation/driver.cxx | 11 ++++++----- sqlite/types/driver.cxx | 8 ++++---- 6 files changed, 22 insertions(+), 16 deletions(-) (limited to 'sqlite') diff --git a/sqlite/custom/driver.cxx b/sqlite/custom/driver.cxx index 9e387b0..d189767 100644 --- a/sqlite/custom/driver.cxx +++ b/sqlite/custom/driver.cxx @@ -18,14 +18,15 @@ #include "test-odb.hxx" using namespace std; -using namespace odb::core; +namespace sqlite = odb::sqlite; +using namespace sqlite; int main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); object o (1); o.nv.push_back ("123"); // INTEGER diff --git a/sqlite/database/driver.cxx b/sqlite/database/driver.cxx index cb531c6..6e09d30 100644 --- a/sqlite/database/driver.cxx +++ b/sqlite/database/driver.cxx @@ -9,7 +9,8 @@ #include -using namespace odb::sqlite; +namespace sqlite = odb::sqlite; +using namespace sqlite; int main (int argc, char* argv[]) diff --git a/sqlite/native/driver.cxx b/sqlite/native/driver.cxx index 30f0197..91b04e6 100644 --- a/sqlite/native/driver.cxx +++ b/sqlite/native/driver.cxx @@ -15,14 +15,16 @@ #include using namespace std; -using namespace odb::core; +namespace sqlite = odb::sqlite; +using namespace sqlite; int main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv, false)); + auto_ptr db ( + create_specific_database (argc, argv, false)); // Create the database schema. // diff --git a/sqlite/template/driver.cxx b/sqlite/template/driver.cxx index 83766fd..c7979df 100644 --- a/sqlite/template/driver.cxx +++ b/sqlite/template/driver.cxx @@ -18,14 +18,15 @@ #include "test-odb.hxx" using namespace std; -using namespace odb::core; +namespace sqlite = odb::sqlite; +using namespace sqlite; int main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); // // diff --git a/sqlite/truncation/driver.cxx b/sqlite/truncation/driver.cxx index c8b9dab..70fde25 100644 --- a/sqlite/truncation/driver.cxx +++ b/sqlite/truncation/driver.cxx @@ -18,7 +18,8 @@ #include "test-odb.hxx" using namespace std; -using namespace odb::core; +namespace sqlite = odb::sqlite; +using namespace sqlite; int main (int argc, char* argv[]) @@ -33,7 +34,7 @@ main (int argc, char* argv[]) // Test basic operations. // { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); // Run persist/load so that the initial bindings are established // (version == 0). @@ -98,10 +99,10 @@ main (int argc, char* argv[]) // Test query. // { - typedef odb::query query; - typedef odb::result result; + auto_ptr db (create_specific_database (argc, argv)); - auto_ptr db (create_database (argc, argv)); + typedef sqlite::query query; + typedef odb::result result; // Run persist/query so that the initial bindings are established // (version == 0). diff --git a/sqlite/types/driver.cxx b/sqlite/types/driver.cxx index ac8c8d4..69e8473 100644 --- a/sqlite/types/driver.cxx +++ b/sqlite/types/driver.cxx @@ -13,21 +13,21 @@ #include #include -#include #include #include "test.hxx" #include "test-odb.hxx" using namespace std; -using namespace odb::core; +namespace sqlite = odb::sqlite; +using namespace sqlite; int main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); object o (1); @@ -58,7 +58,7 @@ main (int argc, char* argv[]) assert (o == *o1); } - typedef odb::query query; + typedef sqlite::query query; typedef odb::result result; #ifdef _WIN32 -- cgit v1.1