ClickHouse/src/Parsers/ParserCreateQuotaQuery.h

37 lines
1.5 KiB
C++
Raw Normal View History

2019-12-01 22:01:05 +00:00
#pragma once
#include <Parsers/IParserBase.h>
namespace DB
{
/** Parses queries like
* CREATE QUOTA [IF NOT EXISTS | OR REPLACE] name
2020-12-02 19:20:47 +00:00
* [KEYED BY {none | user_name | ip_address | forwarded_ip_address | client_key | client_key, user_name | client_key, ip_address} | NOT KEYED]
* [FOR [RANDOMIZED] INTERVAL number {second | minute | hour | day | week | month | quarter | year}
* {MAX {{queries | errors | result_rows | result_bytes | read_rows | read_bytes | execution_time} = number} [,...] |
2020-04-08 03:09:40 +00:00
* NO LIMITS | TRACKING ONLY} [,...]]
2019-12-01 22:01:05 +00:00
* [TO {role [,...] | ALL | ALL EXCEPT role [,...]}]
*
* ALTER QUOTA [IF EXISTS] name
* [RENAME TO new_name]
2020-12-02 19:20:47 +00:00
* [KEYED BY {none | user_name | ip_address | forwarded_ip_address | client_key | client_key, user_name | client_key, ip_address} | NOT KEYED]
* [FOR [RANDOMIZED] INTERVAL number {second | minute | hour | day | week | month | quarter | year}
* {MAX {{queries | errors | result_rows | result_bytes | read_rows | read_bytes | execution_time} = number} [,...] |
2020-04-08 03:09:40 +00:00
* NO LIMITS | TRACKING ONLY} [,...]]
2019-12-01 22:01:05 +00:00
* [TO {role [,...] | ALL | ALL EXCEPT role [,...]}]
*/
class ParserCreateQuotaQuery : public IParserBase
{
public:
void useAttachMode(bool attach_mode_ = true) { attach_mode = attach_mode_; }
2019-12-01 22:01:05 +00:00
protected:
const char * getName() const override { return "CREATE QUOTA or ALTER QUOTA query"; }
bool parseImpl(Pos & pos, ASTPtr & node, Expected & expected) override;
private:
bool attach_mode = false;
2019-12-01 22:01:05 +00:00
};
}