aboutsummaryrefslogtreecommitdiff
path: root/libcommon/common/common.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-06-21 10:39:59 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-06-21 10:39:59 +0200
commit6cd8b9f561b912f264ba4f723845935c40a3cb95 (patch)
tree5983e0af3d2ee621242ca6707a58c89b9914d8f0 /libcommon/common/common.hxx
parent236cd9bb1dd022e64d690c9b0080d1a15c5f61c7 (diff)
Add support for running tests in dynamic multi-database mode
Only possible in the development build system at this stage.
Diffstat (limited to 'libcommon/common/common.hxx')
-rw-r--r--libcommon/common/common.hxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/libcommon/common/common.hxx b/libcommon/common/common.hxx
index 114dbdd..f9bbd4d 100644
--- a/libcommon/common/common.hxx
+++ b/libcommon/common/common.hxx
@@ -20,20 +20,25 @@
#endif
LIBCOMMON_EXPORT std::auto_ptr<odb::database>
-create_database (int& argc,
+create_database (int argc,
char* argv[],
bool create_schema = true,
- std::size_t max_connections = 0);
+ std::size_t max_connections = 0,
+ odb::database_id db = odb::id_common);
template <typename T>
std::auto_ptr<T>
-create_specific_database (int& argc,
+create_specific_database (int argc,
char* argv[],
bool create_schema = true,
std::size_t max_connections = 0)
{
std::auto_ptr<odb::database> r (
- create_database (argc, argv, create_schema, max_connections));
+ create_database (argc, argv,
+ create_schema,
+ max_connections,
+ T::database_id));
+
return std::auto_ptr<T> (&dynamic_cast<T&> (*r.release ()));
}