1#include <Columns/Collator.h>
2#include <Storages/System/StorageSystemCollations.h>
3#include <DataTypes/DataTypeNullable.h>
4
5namespace DB
6{
7
8NamesAndTypesList StorageSystemCollations::getNamesAndTypes()
9{
10 return {
11 {"name", std::make_shared<DataTypeString>()},
12 {"language", std::make_shared<DataTypeNullable>(std::make_shared<DataTypeString>())},
13 };
14}
15
16void StorageSystemCollations::fillData(MutableColumns & res_columns, const Context &, const SelectQueryInfo &) const
17{
18 for (const auto & [locale, lang]: AvailableCollationLocales::instance().getAvailableCollations())
19 {
20 res_columns[0]->insert(locale);
21 res_columns[1]->insert(lang ? *lang : Field());
22 }
23}
24
25}
26