1 | #pragma once |
---|---|
2 | |
3 | #include <Core/Names.h> |
4 | #include <Parsers/IAST_fwd.h> |
5 | |
6 | namespace DB |
7 | { |
8 | |
9 | class ASTQueryParameter; |
10 | |
11 | /// Visit substitutions in a query, replace ASTQueryParameter with ASTLiteral. |
12 | class ReplaceQueryParameterVisitor |
13 | { |
14 | public: |
15 | ReplaceQueryParameterVisitor(const NameToNameMap & parameters) |
16 | : query_parameters(parameters) |
17 | {} |
18 | |
19 | void visit(ASTPtr & ast); |
20 | |
21 | private: |
22 | const NameToNameMap & query_parameters; |
23 | const String & getParamValue(const String & name); |
24 | void visitQueryParameter(ASTPtr & ast); |
25 | }; |
26 | |
27 | } |
28 |