mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-19 06:01:57 +00:00
27 lines
513 B
C++
27 lines
513 B
C++
#include <DB/Databases/DatabaseFactory.h>
|
|
#include <DB/Databases/DatabaseOrdinary.h>
|
|
|
|
|
|
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<DatabaseOrdinary>(database_name, path);
|
|
|
|
throw Exception("Unknown database engine: " + engine_name, ErrorCodes::UNKNOWN_DATABASE_ENGINE);
|
|
}
|
|
|
|
}
|