aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tools/sql_functions_dump/sql_functions_dump.cpp
blob: 66dae62d636e56132c0e351c4540912b3f6bd4f3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <yql/essentials/sql/v1/node.h>
#include <yql/essentials/utils/backtrace/backtrace.h>
#include <library/cpp/json/writer/json.h>
#include <util/generic/yexception.h>

using namespace NYql;

int Main(int argc, const char *argv[])
{
    Y_UNUSED(argc);
    Y_UNUSED(argv);
    NJsonWriter::TBuf json;
    json.BeginList();
    NSQLTranslationV1::EnumerateBuiltins([&](auto name, auto kind) {
        json.BeginObject();
        json.WriteKey("name");
        json.WriteString(name);
        json.WriteKey("kind");
        json.WriteString(kind);
        json.EndObject();
    });

    json.EndList();
    Cout << json.Str() << Endl;

    return 0;
}

int main(int argc, const char *argv[]) {
    NYql::NBacktrace::RegisterKikimrFatalActions();
    NYql::NBacktrace::EnableKikimrSymbolize();

    try {
        return Main(argc, argv);
    }
    catch (...) {
        Cerr << CurrentExceptionMessage() << Endl;
        return 1;
    }
}