mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
52 lines
1.4 KiB
C++
52 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include <Parsers/IAST.h>
|
|
#include <Access/RowPolicy.h>
|
|
#include <utility>
|
|
#include <vector>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
class ASTExtendedRoleSet;
|
|
|
|
/** CREATE [ROW] POLICY [IF NOT EXISTS | OR REPLACE] name ON [database.]table
|
|
* [AS {PERMISSIVE | RESTRICTIVE}]
|
|
* [FOR {SELECT | INSERT | UPDATE | DELETE | ALL}]
|
|
* [USING condition]
|
|
* [WITH CHECK condition] [,...]
|
|
* [TO {role [,...] | ALL | ALL EXCEPT role [,...]}]
|
|
*
|
|
* ALTER [ROW] POLICY [IF EXISTS] name ON [database.]table
|
|
* [RENAME TO new_name]
|
|
* [AS {PERMISSIVE | RESTRICTIVE}]
|
|
* [FOR {SELECT | INSERT | UPDATE | DELETE | ALL}]
|
|
* [USING {condition | NONE}]
|
|
* [WITH CHECK {condition | NONE}] [,...]
|
|
* [TO {role [,...] | ALL | ALL EXCEPT role [,...]}]
|
|
*/
|
|
class ASTCreateRowPolicyQuery : public IAST
|
|
{
|
|
public:
|
|
bool alter = false;
|
|
bool attach = false;
|
|
|
|
bool if_exists = false;
|
|
bool if_not_exists = false;
|
|
bool or_replace = false;
|
|
|
|
RowPolicy::FullNameParts name_parts;
|
|
String new_policy_name;
|
|
|
|
std::optional<bool> is_restrictive;
|
|
using ConditionType = RowPolicy::ConditionType;
|
|
std::vector<std::pair<ConditionType, ASTPtr>> conditions;
|
|
|
|
std::shared_ptr<ASTExtendedRoleSet> roles;
|
|
|
|
String getID(char) const override;
|
|
ASTPtr clone() const override;
|
|
void formatImpl(const FormatSettings & settings, FormatState &, FormatStateStacked) const override;
|
|
};
|
|
}
|