final class RoleSelection
    implements Node
    uses Snapshot
Public API: explicitly declared with @visibility public.

The roles SET ROLE, a DEFAULT ROLE clause or GRANT … AS … WITH ROLE select: role, …, NONE, DEFAULT or ALL [EXCEPT role, …].

The roles are the named ones for Named and the excepted ones for All. Source: https://dev.mysql.com/doc/refman/8.4/en/set-role.html, https://dev.mysql.com/doc/refman/8.4/en/set-default-role.html.

Selecting all roles but onedoctest
$selection = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('SET ROLE ALL EXCEPT r')->statement->roles;
    [$selection->set, $selection->roles[0]->user->value] // => [\SqlSemantics\Platform\MySql\Statement\Account\User\RoleSet::All, 'r']

Properties§

public list<AccountName> $roles
public RoleSet $set

Methods§

public function __construct(public RoleSet $set, list<AccountName> $roles = [])

Parameters

$setRoleSetWhich roles are selected
$roleslist<AccountName>The named roles (at least one), or the roles EXCEPT names; none otherwise
Calls 7
public function render(Output $out): void

Writes the selection.

Parameters

$outOutput
Calls 6

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 14
Type declarations 5