mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-13 18:02:24 +00:00
24 lines
445 B
C++
24 lines
445 B
C++
#include <Parsers/formatAST.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
String formatColumnsForCreateQuery(NamesAndTypesList & columns)
|
|
{
|
|
std::string res;
|
|
res += "(";
|
|
for (NamesAndTypesList::iterator it = columns.begin(); it != columns.end(); ++it)
|
|
{
|
|
if (it != columns.begin())
|
|
res += ", ";
|
|
res += backQuoteIfNeed(it->name);
|
|
res += " ";
|
|
res += it->type->getName();
|
|
}
|
|
res += ")";
|
|
return res;
|
|
}
|
|
|
|
}
|