aboutsummaryrefslogtreecommitdiff
path: root/schema/custom/database.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'schema/custom/database.hxx')
-rw-r--r--schema/custom/database.hxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/schema/custom/database.hxx b/schema/custom/database.hxx
index 88536ab..932e6c4 100644
--- a/schema/custom/database.hxx
+++ b/schema/custom/database.hxx
@@ -18,6 +18,8 @@
#if defined(DATABASE_MYSQL)
# include <odb/mysql/database.hxx>
+#elif defined(DATABASE_SQLITE)
+# include <odb/sqlite/database.hxx>
#endif
inline std::auto_ptr<odb::database>
@@ -33,14 +35,22 @@ create_database (int& argc, char* argv[])
#if defined(DATABASE_MYSQL)
odb::mysql::database::print_usage (cerr);
+#elif defined(DATABASE_SQLITE)
+ odb::sqlite::database::print_usage (cerr);
#endif
exit (0);
}
#if defined(DATABASE_MYSQL)
- return auto_ptr<database> (new odb::mysql::database (argc, argv));
+ auto_ptr<database> db (new odb::mysql::database (argc, argv));
+#elif defined(DATABASE_SQLITE)
+ auto_ptr<database> db (
+ new odb::sqlite::database (
+ argc, argv, false, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE));
#endif
+
+ return db;
}
#endif // DATABASE_HXX