2020-02-17 02:59:56 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Parsers/IAST.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2020-03-07 17:37:38 +00:00
|
|
|
class ASTExtendedRoleSet;
|
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-03-07 17:37:38 +00:00
|
|
|
std::shared_ptr<ASTExtendedRoleSet> roles;
|
|
|
|
std::shared_ptr<ASTExtendedRoleSet> 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;
|
|
|
|
};
|
|
|
|
}
|