ClickHouse/dbms/Parsers/ASTUseQuery.h
Ivan 97f2a2213e
Move all folders inside /dbms one level up (#9974)
* Move some code outside dbms/src folder
* Fix paths
2020-04-02 02:51:21 +03:00

32 lines
694 B
C++

#pragma once
#include <Parsers/IAST.h>
#include <Common/quoteString.h>
namespace DB
{
/** USE query
*/
class ASTUseQuery : public IAST
{
public:
String database;
/** Get the text that identifies this element. */
String getID(char delim) const override { return "UseQuery" + (delim + database); }
ASTPtr clone() const override { return std::make_shared<ASTUseQuery>(*this); }
protected:
void formatImpl(const FormatSettings & settings, FormatState &, FormatStateStacked) const override
{
settings.ostr << (settings.hilite ? hilite_keyword : "") << "USE " << (settings.hilite ? hilite_none : "") << backQuoteIfNeed(database);
return;
}
};
}