#include #include #include #include namespace DB { namespace ErrorCodes { extern const int UNKNOWN_DATABASE_ENGINE; } DatabasePtr DatabaseFactory::get( const String & engine_name, const String & database_name, const String & path, Context & context) { if (engine_name == "Ordinary") return std::make_shared(database_name, path); else if (engine_name == "Memory") return std::make_shared(database_name); else if (engine_name == "Dictionary") return std::make_shared(database_name); throw Exception("Unknown database engine: " + engine_name, ErrorCodes::UNKNOWN_DATABASE_ENGINE); } }