mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
34 lines
758 B
C++
34 lines
758 B
C++
#pragma once
|
|
|
|
#include <DB/Parsers/IAST.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
|
|
/** USE запрос
|
|
*/
|
|
class ASTUseQuery : public IAST
|
|
{
|
|
public:
|
|
String database;
|
|
|
|
ASTUseQuery() = default;
|
|
ASTUseQuery(const StringRange range_) : IAST(range_) {}
|
|
|
|
/** Получить текст, который идентифицирует этот элемент. */
|
|
String getID() const override { return "UseQuery_" + database; };
|
|
|
|
ASTPtr clone() const override { return new ASTUseQuery(*this); }
|
|
|
|
protected:
|
|
void formatImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const override
|
|
{
|
|
settings.ostr << (settings.hilite ? hilite_keyword : "") << "USE " << (settings.hilite ? hilite_none : "") << backQuoteIfNeed(database);
|
|
return;
|
|
}
|
|
};
|
|
|
|
}
|