classSetDefaultRole
final class SetDefaultRole
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.SET DEFAULT ROLE {NONE | ALL | role, …} TO account, … (8.0+): a request to set the default roles of accounts.
Mirrors PT_alter_user_default_role as SET DEFAULT ROLE builds it. Rule: MYSQL-SET-DEFAULT-ROLE-001. The accounts are written in the role name syntax, without CURRENT_USER. Source: https://dev.mysql.com/doc/refman/8.4/en/set-default-role.html. Status: Implemented.
(new \SqlSemantics\Platform\MySql\Semantics())->analyze('set default role none to a, b')->toString() // => 'SET DEFAULT ROLE NONE TO a, b'Properties§
public list<AccountName> $userspublic RoleSelection $rolesMethods§
public function __construct(public RoleSelection $roles, list<AccountName> $users)Parameters
$roles | RoleSelection | The default roles: named roles, ALL or NONE |
$users | list<AccountName> | The accounts in order; at least one |
Calls 5
- static-call Check::input() line 43
- class-const RoleSet::Default() line 43
- class-const RoleSet::All() line 43
- static-call Check::listOf() line 44
- class-const AccountName::class() line 44
public function deriveStatement(Derivation $derivation): voidDerives nothing: the statement names no relation and no expression.
Parameters
$derivation | Derivation |
public function render(Output $out): voidTest cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
SetDefaultRoleTestcalls
Relations§
Instantiated in 3
- new SqlSemantics\Platform\MySql\Lowering\Account\RoleRule::statement() packages/sql-semantics-mysql/src/Lowering/Account/RoleRule.php:57
- new SqlSemantics\Platform\MySql\Lowering\Account\RoleRule::statement() packages/sql-semantics-mysql/src/Lowering/Account/RoleRule.php:58
- new SqlSemantics\Platform\MySql\Lowering\Account\RoleRule::statement() packages/sql-semantics-mysql/src/Lowering/Account/RoleRule.php:59