ClickHouse/dbms/src/Interpreters/ReplaceQueryParameterVisitor.h

28 lines
552 B
C++
Raw Normal View History

2019-05-18 21:07:23 +00:00
#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:
2019-05-25 13:43:52 +00:00
ReplaceQueryParameterVisitor(const NameToNameMap & parameters)
: parameters_substitution(parameters)
2019-05-18 21:07:23 +00:00
{}
void visit(ASTPtr & ast);
private:
2019-05-25 13:43:52 +00:00
const NameToNameMap parameters_substitution;
2019-06-14 16:18:59 +00:00
const String & getParamValue(const String & name);
void visitQueryParameter(ASTPtr & ast);
2019-05-18 21:07:23 +00:00
};
}