2020-02-17 02:59:56 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Parsers/IAST.h>
|
2020-04-05 23:03:20 +00:00
|
|
|
#include <Parsers/ASTQueryWithOnCluster.h>
|
2020-02-17 02:59:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2020-03-18 14:11:44 +00:00
|
|
|
class ASTSettingsProfileElements;
|
|
|
|
|
|
|
|
|
2020-02-17 02:59:56 +00:00
|
|
|
/** CREATE ROLE [IF NOT EXISTS | OR REPLACE] name
|
2020-03-18 14:11:44 +00:00
|
|
|
* [SETTINGS variable [= value] [MIN [=] min_value] [MAX [=] max_value] [READONLY|WRITABLE] | PROFILE 'profile_name'] [,...]
|
2020-02-17 02:59:56 +00:00
|
|
|
*
|
|
|
|
* ALTER ROLE [IF EXISTS] name
|
2020-03-18 14:11:44 +00:00
|
|
|
* [RENAME TO new_name]
|
|
|
|
* [SETTINGS variable [= value] [MIN [=] min_value] [MAX [=] max_value] [READONLY|WRITABLE] | PROFILE 'profile_name'] [,...]
|
2020-02-17 02:59:56 +00:00
|
|
|
*/
|
2020-04-05 23:03:20 +00:00
|
|
|
class ASTCreateRoleQuery : public IAST, public ASTQueryWithOnCluster
|
2020-02-17 02:59:56 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool alter = false;
|
2020-02-21 19:27:12 +00:00
|
|
|
bool attach = false;
|
2020-02-17 02:59:56 +00:00
|
|
|
|
|
|
|
bool if_exists = false;
|
|
|
|
bool if_not_exists = false;
|
|
|
|
bool or_replace = false;
|
|
|
|
|
2020-05-30 14:18:08 +00:00
|
|
|
Strings names;
|
2020-02-17 02:59:56 +00:00
|
|
|
String new_name;
|
|
|
|
|
2020-03-18 14:11:44 +00:00
|
|
|
std::shared_ptr<ASTSettingsProfileElements> settings;
|
|
|
|
|
2020-02-17 02:59:56 +00:00
|
|
|
String getID(char) const override;
|
|
|
|
ASTPtr clone() const override;
|
2020-03-18 14:11:44 +00:00
|
|
|
void formatImpl(const FormatSettings & format, FormatState &, FormatStateStacked) const override;
|
2020-04-05 23:03:20 +00:00
|
|
|
ASTPtr getRewrittenASTWithoutOnCluster(const std::string &) const override { return removeOnCluster<ASTCreateRoleQuery>(clone()); }
|
2020-02-17 02:59:56 +00:00
|
|
|
};
|
|
|
|
}
|