ClickHouse/dbms/src/Interpreters/ReplaceQueryParameterVisitor.h
Alexander Tretiakov c661f5c0a1 new
2019-05-19 00:07:23 +03:00

28 lines
514 B
C++

#pragma once
#include <Core/Names.h>
#include <Parsers/IAST_fwd.h>
namespace DB
{
class ASTQueryParameter;
/// Get prepared statements in query, replace ASTQueryParameter with ASTLiteral.
class ReplaceQueryParameterVisitor
{
public:
ReplaceQueryParameterVisitor(const NameToNameMap & params)
: params_substitution(params)
{}
void visit(ASTPtr & ast);
private:
const NameToNameMap params_substitution;
void visitQP(ASTPtr & ast);
String getParamValue(const String & name);
};
}