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