diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-02-18 10:42:41 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-02-18 10:42:41 +0200 |
commit | 4a250a49537bf223b3665c0f5a017944531b3dfe (patch) | |
tree | 032830fddd78c35f4501cdb3e98f28af544f9be0 /libcommon | |
parent | 4067bb225c7238d54b5a09ab4d3d23f60aef8a05 (diff) |
Add odb::core namespace to be used in using-directives
Port all the examples and tests.
Diffstat (limited to 'libcommon')
-rw-r--r-- | libcommon/common/common.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index d451c4b..bffc0fc 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -18,9 +18,12 @@ #include <common/common.hxx> using namespace std; -using namespace odb; -auto_ptr<database> +#if defined(DATABASE_MYSQL) +using namespace odb::mysql; +#endif + +auto_ptr<odb::database> create_database (int& argc, char* argv[], size_t max_connections) { if (argc > 1 && argv[1] == string ("--help")) @@ -28,19 +31,16 @@ create_database (int& argc, char* argv[], size_t max_connections) cerr << "Usage: " << argv[0] << " [options]" << endl << "Options:" << endl; -#if defined(DATABASE_MYSQL) - mysql::database::print_usage (cerr); -#endif - + database::print_usage (cerr); exit (0); } #if defined(DATABASE_MYSQL) - auto_ptr<mysql::connection_factory> f; + auto_ptr<connection_factory> f; if (max_connections != 0) - f.reset (new mysql::connection_pool_factory (max_connections)); + f.reset (new connection_pool_factory (max_connections)); - return auto_ptr<database> (new mysql::database (argc, argv, false, 0, f)); + return auto_ptr<odb::database> (new database (argc, argv, false, 0, f)); #endif } |