1 | #pragma once |
2 | |
3 | #include <Parsers/IParserBase.h> |
4 | |
5 | |
6 | namespace DB |
7 | { |
8 | /** Parses queries like |
9 | * CREATE QUOTA [IF NOT EXISTS | OR REPLACE] name |
10 | * [KEYED BY {'none' | 'user name' | 'ip address' | 'client key' | 'client key or user name' | 'client key or ip address'}] |
11 | * [FOR [RANDOMIZED] INTERVAL number {SECOND | MINUTE | HOUR | DAY} |
12 | * {[SET] MAX {{QUERIES | ERRORS | RESULT ROWS | RESULT BYTES | READ ROWS | READ BYTES | EXECUTION TIME} = {number | ANY} } [,...] | |
13 | * [SET] TRACKING} [,...]] |
14 | * [TO {role [,...] | ALL | ALL EXCEPT role [,...]}] |
15 | * |
16 | * ALTER QUOTA [IF EXISTS] name |
17 | * [RENAME TO new_name] |
18 | * [KEYED BY {'none' | 'user name' | 'ip address' | 'client key' | 'client key or user name' | 'client key or ip address'}] |
19 | * [FOR [RANDOMIZED] INTERVAL number {SECOND | MINUTE | HOUR | DAY} |
20 | * {[SET] MAX {{QUERIES | ERRORS | RESULT ROWS | RESULT BYTES | READ ROWS | READ BYTES | EXECUTION TIME} = {number | ANY} } [,...] | |
21 | * [SET] TRACKING | |
22 | * UNSET TRACKING} [,...]] |
23 | * [TO {role [,...] | ALL | ALL EXCEPT role [,...]}] |
24 | */ |
25 | class ParserCreateQuotaQuery : public IParserBase |
26 | { |
27 | protected: |
28 | const char * getName() const override { return "CREATE QUOTA or ALTER QUOTA query" ; } |
29 | bool parseImpl(Pos & pos, ASTPtr & node, Expected & expected) override; |
30 | }; |
31 | } |
32 | |