```
milovidov@milovidov-desktop:~/work/ClickHouse$ build/utils/db-generator/query_db_generator 
^C
milovidov@milovidov-desktop:~/work/ClickHouse$ build/utils/db-generator/query_db_generator --help
^C
milovidov@milovidov-desktop:~/work/ClickHouse$ build/utils/db-generator/query_db_generator < query.sql 
milovidov@milovidov-desktop:~/work/ClickHouse$ build/utils/db-generator/query_db_generator query.sql 
^C
```

{
        auto ch = std::dynamic_pointer_cast<DB::ASTTablesInSelectQueryElement>(child);
        auto table_expression_ast = std::dynamic_pointer_cast<DB::ASTTableExpression>(ch->table_expression);
        if (table_expression_ast && table_expression_ast->database_and_table_name)
        {
            auto table_name = *(getIndent(table_expression_ast->database_and_table_name).begin());
            all_tables.addTable(table_name);
            auto alias = getAlias(ch);
            if (!alias.empty())
                all_tables.aliases[alias] = table_name;
        }
        if (table_expression_ast && table_expression_ast->subquery)
        {
            for (const auto & select : getSelect(table_expression_ast->subquery))
            {
                TableList local;
                parseSelectQuery(select, local);
                all_tables.merge(local);
            }
        }
        if (ch->table_join)
        {
            auto jch = std::dynamic_pointer_cast<DB::ASTTableJoin>(ch->table_join);
            if (jch->using_expression_list)
            {
                auto join_columns = getIndent(jch->using_expression_list);
                columns.insert(join_columns.begin(), join_columns.end());
            }
            else if (jch->on_expression)
            {