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.

Setting every granted role as defaultdoctest
(new \SqlSemantics\Platform\MySql\Semantics())->analyze('alter user u default role all')->statement->roles->set // => \SqlSemantics\Platform\MySql\Statement\Account\User\RoleSet::All

Properties§

public bool $ifExists
public Account $user
public RoleSelection $roles

Methods§

public function __construct(
    public bool $ifExists,
    public Account $user,
    public RoleSelection $roles,
)

Parameters

$ifExistsboolWhether IF EXISTS is written
$userAccountThe account
$rolesRoleSelectionThe default roles: named roles, ALL or NONE
Calls 3
public function deriveStatement(Derivation $derivation): void

Derives nothing: the statement names no relation and no expression.

Parameters

$derivationDerivation
public function render(Output $out): void

Writes the request.

Parameters

$outOutput
Calls 2

Test cases 1§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1

Relations§

Instantiated in 3