ClickHouse/dbms/src/Interpreters/ReplaceQueryParameterVisitor.h
2019-06-15 20:52:53 +03:00

28 lines
538 B
C++

#pragma once
#include <Core/Names.h>
#include <Parsers/IAST_fwd.h>
namespace DB
{
class ASTQueryParameter;
/// Visit substitutions in a query, replace ASTQueryParameter with ASTLiteral.
class ReplaceQueryParameterVisitor
{
public:
ReplaceQueryParameterVisitor(const NameToNameMap & parameters)
: query_parameters(parameters)
{}
void visit(ASTPtr & ast);
private:
const NameToNameMap & query_parameters;
const String & getParamValue(const String & name);
void visitQueryParameter(ASTPtr & ast);
};
}