aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Parsers/formatAST.cpp
blob: 9315279eae6323f5927c3fc41c7f83578ccefa6e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#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();
}

}