aboutsummaryrefslogtreecommitdiff
path: root/libcommon/common
diff options
context:
space:
mode:
Diffstat (limited to 'libcommon/common')
-rw-r--r--libcommon/common/common.cxx10
-rw-r--r--libcommon/common/common.hxx5
2 files changed, 13 insertions, 2 deletions
diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx
index 1ed65e3..a6fa4e1 100644
--- a/libcommon/common/common.cxx
+++ b/libcommon/common/common.cxx
@@ -34,7 +34,14 @@ namespace sqlite = odb::sqlite;
#endif
auto_ptr<database>
-create_database (int& argc, char* argv[], size_t max_connections)
+create_database (int& argc,
+ char* argv[],
+#if defined(DATABASE_SQLITE)
+ bool schema,
+#else
+ bool,
+#endif
+ size_t max_connections)
{
if (argc > 1 && argv[1] == string ("--help"))
{
@@ -71,6 +78,7 @@ create_database (int& argc, char* argv[], size_t max_connections)
// Create the database schema.
//
+ if (schema)
{
transaction t (db->begin ());
schema_catalog::create_schema (*db);
diff --git a/libcommon/common/common.hxx b/libcommon/common/common.hxx
index 23e9d80..6ace845 100644
--- a/libcommon/common/common.hxx
+++ b/libcommon/common/common.hxx
@@ -16,7 +16,10 @@
#include <common/export.hxx>
LIBCOMMON_EXPORT std::auto_ptr<odb::database>
-create_database (int& argc, char* argv[], std::size_t max_connections = 0);
+create_database (int& argc,
+ char* argv[],
+ bool create_schema = true,
+ std::size_t max_connections = 0);
// This function returns an accurate result only if the result iterator
// hasn't been advanced.