2020-02-17 02:59:56 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Parsers/IAST.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2020-05-30 20:10:45 +00:00
|
|
|
class ASTRolesOrUsersSet;
|
2020-02-17 02:59:56 +00:00
|
|
|
|
|
|
|
/** SET ROLE {DEFAULT | NONE | role [,...] | ALL | ALL EXCEPT role [,...]}
|
|
|
|
* SET DEFAULT ROLE {NONE | role [,...] | ALL | ALL EXCEPT role [,...]} TO {user|CURRENT_USER} [,...]
|
|
|
|
*/
|
|
|
|
class ASTSetRoleQuery : public IAST
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum class Kind
|
|
|
|
{
|
|
|
|
SET_ROLE,
|
|
|
|
SET_ROLE_DEFAULT,
|
|
|
|
SET_DEFAULT_ROLE,
|
|
|
|
};
|
|
|
|
Kind kind = Kind::SET_ROLE;
|
|
|
|
|
2020-05-30 20:10:45 +00:00
|
|
|
std::shared_ptr<ASTRolesOrUsersSet> roles;
|
|
|
|
std::shared_ptr<ASTRolesOrUsersSet> to_users;
|
2020-02-17 02:59:56 +00:00
|
|
|
|
|
|
|
String getID(char) const override;
|
|
|
|
ASTPtr clone() const override;
|
|
|
|
void formatImpl(const FormatSettings & settings, FormatState &, FormatStateStacked) const override;
|
|
|
|
};
|
|
|
|
}
|