2020-02-17 02:59:56 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Parsers/IParserBase.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
/** Parses queries like
|
|
|
|
* 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 ParserCreateRoleQuery : public IParserBase
|
|
|
|
{
|
2020-02-21 19:27:12 +00:00
|
|
|
public:
|
|
|
|
ParserCreateRoleQuery & enableAttachMode(bool enable) { attach_mode = enable; return *this; }
|
|
|
|
|
2020-02-17 02:59:56 +00:00
|
|
|
protected:
|
|
|
|
const char * getName() const override { return "CREATE ROLE or ALTER ROLE query"; }
|
|
|
|
bool parseImpl(Pos & pos, ASTPtr & node, Expected & expected) override;
|
2020-02-21 19:27:12 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
bool attach_mode = false;
|
2020-02-17 02:59:56 +00:00
|
|
|
};
|
|
|
|
}
|