1 | #pragma once |
---|---|
2 | |
3 | #include <Interpreters/IInterpreter.h> |
4 | #include <Parsers/IAST_fwd.h> |
5 | |
6 | |
7 | namespace DB |
8 | { |
9 | class ASTCreateQuotaQuery; |
10 | struct Quota; |
11 | |
12 | |
13 | class InterpreterCreateQuotaQuery : public IInterpreter |
14 | { |
15 | public: |
16 | InterpreterCreateQuotaQuery(const ASTPtr & query_ptr_, Context & context_) : query_ptr(query_ptr_), context(context_) {} |
17 | |
18 | BlockIO execute() override; |
19 | |
20 | bool ignoreQuota() const override { return true; } |
21 | bool ignoreLimits() const override { return true; } |
22 | |
23 | private: |
24 | void updateQuotaFromQuery(Quota & quota, const ASTCreateQuotaQuery & query); |
25 | |
26 | ASTPtr query_ptr; |
27 | Context & context; |
28 | }; |
29 | } |
30 |