mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-19 14:11:58 +00:00
24 lines
394 B
C++
24 lines
394 B
C++
#include <DB/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;
|
|
}
|
|
|
|
}
|