ClickHouse/dbms/Parsers/ASTDropAccessEntityQuery.h

39 lines
867 B
C++
Raw Normal View History

2019-12-01 22:01:05 +00:00
#pragma once
#include <Parsers/IAST.h>
2019-11-29 17:22:56 +00:00
#include <Access/RowPolicy.h>
2019-12-01 22:01:05 +00:00
namespace DB
{
/** DROP USER [IF EXISTS] name [,...]
* DROP ROLE [IF EXISTS] name [,...]
* DROP QUOTA [IF EXISTS] name [,...]
2019-11-29 17:22:56 +00:00
* DROP [ROW] POLICY [IF EXISTS] name [,...] ON [database.]table [,...]
* DROP [SETTINGS] PROFILE [IF EXISTS] name [,...]
2019-12-01 22:01:05 +00:00
*/
class ASTDropAccessEntityQuery : public IAST
{
public:
enum class Kind
{
USER,
ROLE,
2019-12-01 22:01:05 +00:00
QUOTA,
2019-11-29 17:22:56 +00:00
ROW_POLICY,
SETTINGS_PROFILE,
2019-12-01 22:01:05 +00:00
};
2019-12-01 22:01:05 +00:00
const Kind kind;
bool if_exists = false;
Strings names;
2019-11-29 17:22:56 +00:00
std::vector<RowPolicy::FullNameParts> row_policies_names;
2019-12-01 22:01:05 +00:00
ASTDropAccessEntityQuery(Kind kind_);
String getID(char) const override;
ASTPtr clone() const override;
void formatImpl(const FormatSettings & settings, FormatState &, FormatStateStacked) const override;
};
}