classAlterDefaultRole
final class AlterDefaultRole
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.ALTER USER [IF EXISTS] account DEFAULT ROLE {ALL | NONE | role, …} (8.0+): a request to set the default roles of an account.
Mirrors PT_alter_user_default_role. Rule: MYSQL-ALTER-DEFAULT-ROLE-001. Source: https://dev.mysql.com/doc/refman/8.4/en/alter-user.html#alter-user-role. Status: Implemented.
(new \SqlSemantics\Platform\MySql\Semantics())->analyze('alter user u default role all')->statement->roles->set // => \SqlSemantics\Platform\MySql\Statement\Account\User\RoleSet::AllProperties§
public bool $ifExistspublic Account $userpublic RoleSelection $rolesMethods§
public function __construct(
public bool $ifExists,
public Account $user,
public RoleSelection $roles,
)Parameters
$ifExists | bool | Whether IF EXISTS is written |
$user | Account | The account |
$roles | RoleSelection | The default roles: named roles, ALL or NONE |
Calls 3
- static-call Check::input() line 37
- class-const RoleSet::Default() line 37
- class-const RoleSet::All() line 37
public function deriveStatement(Derivation $derivation): voidDerives nothing: the statement names no relation and no expression.
Parameters
$derivation | Derivation |
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 52
- method-call Output::node() line 56
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
AlterDefaultRoleTestcalls
Relations§
Instantiated in 3
- new SqlSemantics\Platform\MySql\Lowering\Account\UserStatementRule::alter() packages/sql-semantics-mysql/src/Lowering/Account/UserStatementRule.php:151
- new SqlSemantics\Platform\MySql\Lowering\Account\UserStatementRule::alter() packages/sql-semantics-mysql/src/Lowering/Account/UserStatementRule.php:152
- new SqlSemantics\Platform\MySql\Lowering\Account\UserStatementRule::alter() packages/sql-semantics-mysql/src/Lowering/Account/UserStatementRule.php:153