1#include <Parsers/ASTShowQuotasQuery.h>
2#include <Common/quoteString.h>
3
4
5namespace DB
6{
7String ASTShowQuotasQuery::getID(char) const
8{
9 if (usage)
10 return "SHOW QUOTA USAGE query";
11 else
12 return "SHOW QUOTAS query";
13}
14
15
16ASTPtr ASTShowQuotasQuery::clone() const
17{
18 return std::make_shared<ASTShowQuotasQuery>(*this);
19}
20
21
22void ASTShowQuotasQuery::formatQueryImpl(const FormatSettings & settings, FormatState &, FormatStateStacked) const
23{
24 settings.ostr << (settings.hilite ? hilite_keyword : "");
25
26 if (usage && current)
27 settings.ostr << "SHOW QUOTA USAGE";
28 else if (usage)
29 settings.ostr << "SHOW QUOTA USAGE ALL";
30 else
31 settings.ostr << "SHOW QUOTAS";
32
33 settings.ostr << (settings.hilite ? hilite_none : "");
34}
35}
36