1 | #pragma once |
2 | |
3 | #include <Parsers/IParserBase.h> |
4 | |
5 | |
6 | namespace DB |
7 | { |
8 | /** Parses queries like |
9 | * CREATE [ROW] POLICY [IF NOT EXISTS | OR REPLACE] name ON [database.]table |
10 | * [AS {PERMISSIVE | RESTRICTIVE}] |
11 | * [FOR {SELECT | INSERT | UPDATE | DELETE | ALL}] |
12 | * [USING condition] |
13 | * [WITH CHECK condition] [,...] |
14 | * [TO {role [,...] | ALL | ALL EXCEPT role [,...]}] |
15 | * |
16 | * ALTER [ROW] POLICY [IF EXISTS] name ON [database.]table |
17 | * [RENAME TO new_name] |
18 | * [AS {PERMISSIVE | RESTRICTIVE}] |
19 | * [FOR {SELECT | INSERT | UPDATE | DELETE | ALL}] |
20 | * [USING {condition | NONE}] |
21 | * [WITH CHECK {condition | NONE}] [,...] |
22 | * [TO {role [,...] | ALL | ALL EXCEPT role [,...]}] |
23 | */ |
24 | class ParserCreateRowPolicyQuery : public IParserBase |
25 | { |
26 | protected: |
27 | const char * getName() const override { return "CREATE ROW POLICY or ALTER ROW POLICY query" ; } |
28 | bool parseImpl(Pos & pos, ASTPtr & node, Expected & expected) override; |
29 | }; |
30 | } |
31 | |