ClickHouse/src/Storages/System/StorageSystemDatabaseEngines.cpp
2024-01-12 16:39:22 +01:00

27 lines
681 B
C++

#include <DataTypes/DataTypeString.h>
#include <DataTypes/DataTypesNumber.h>
#include <Databases/DatabaseFactory.h>
#include <Storages/System/StorageSystemDatabaseEngines.h>
namespace DB
{
ColumnsDescription StorageSystemDatabaseEngines::getColumnsDescription()
{
return ColumnsDescription
{
{"name", std::make_shared<DataTypeString>(), "The name of database engine."},
};
}
void StorageSystemDatabaseEngines::fillData(MutableColumns & res_columns, ContextPtr, const SelectQueryInfo &) const
{
for (const auto & [engine, _] : DatabaseFactory::instance().getDatabaseEngines())
{
int i = 0;
res_columns[i++]->insert(engine);
}
}
}