2020-02-17 02:59:56 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Parsers/IAST.h>
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
*/
|
|
|
|
class ASTCreateRoleQuery : public IAST
|
|
|
|
{
|
|
|
|
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;
|
|
|
|
|
|
|
|
String name;
|
|
|
|
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-02-17 02:59:56 +00:00
|
|
|
};
|
|
|
|
}
|