1#pragma once
2
3#include <Core/Types.h>
4#include <Core/NamesAndTypes.h>
5#include <Parsers/IdentifierQuotingStyle.h>
6
7
8namespace DB
9{
10
11class IAST;
12class Context;
13
14/** For given ClickHouse query,
15 * creates another query in a form of
16 *
17 * SELECT columns... FROM db.table WHERE ...
18 *
19 * where 'columns' are all required columns to read from "left" table of original query,
20 * and WHERE contains subset of (AND-ed) conditions from original query,
21 * that contain only compatible expressions.
22 *
23 * Compatible expressions are comparisons of identifiers, constants, and logical operations on them.
24 */
25String transformQueryForExternalDatabase(
26 const IAST & query,
27 const NamesAndTypesList & available_columns,
28 IdentifierQuotingStyle identifier_quoting_style,
29 const String & database,
30 const String & table,
31 const Context & context);
32
33}
34