From 534c5958af6104aea60a9fcb0d823a5c3cfed1bc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 25 Mar 2011 13:09:06 +0200 Subject: SQLite support --- schema/custom/database.hxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'schema/custom') 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 +#elif defined(DATABASE_SQLITE) +# include #endif inline std::auto_ptr @@ -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 (new odb::mysql::database (argc, argv)); + auto_ptr db (new odb::mysql::database (argc, argv)); +#elif defined(DATABASE_SQLITE) + auto_ptr db ( + new odb::sqlite::database ( + argc, argv, false, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE)); #endif + + return db; } #endif // DATABASE_HXX -- cgit v1.1