ClickHouse/src/Parsers/formatAST.cpp
2023-07-20 10:39:26 +00:00

22 lines
418 B
C++

#include <Parsers/formatAST.h>
namespace DB
{
void formatAST(const IAST & ast, WriteBuffer & buf, bool hilite, bool one_line, bool show_secrets)
{
IAST::FormatSettings settings(buf, one_line, hilite);
settings.show_secrets = show_secrets;
ast.format(settings);
}
String serializeAST(const IAST & ast)
{
WriteBufferFromOwnString buf;
formatAST(ast, buf, false, true);
return buf.str();
}
}