// file : libcommon/common/common.cxx // author : Boris Kolpackov // copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include // std::exit #include #include #if defined(DATABASE_MYSQL) # include # include #else # error unknown database #endif #include using namespace std; #if defined(DATABASE_MYSQL) using namespace odb::mysql; #endif auto_ptr create_database (int& argc, char* argv[], size_t max_connections) { if (argc > 1 && argv[1] == string ("--help")) { cerr << "Usage: " << argv[0] << " [options]" << endl << "Options:" << endl; database::print_usage (cerr); exit (0); } #if defined(DATABASE_MYSQL) auto_ptr f; if (max_connections != 0) f.reset (new connection_pool_factory (max_connections)); return auto_ptr (new database (argc, argv, false, 0, f)); #endif }