final class SetRole
    implements Statement
    uses Snapshot
Public API: explicitly declared with @visibility public.

SET ROLE {DEFAULT | NONE | ALL [EXCEPT role, …] | role, …} (8.0+): a request to change the active roles of the session.

Mirrors PT_set_role. Rule: MYSQL-SET-ROLE-001. Source: https://dev.mysql.com/doc/refman/8.4/en/set-role.html. Status: Implemented.

Activating named rolesdoctest
(new \SqlSemantics\Platform\MySql\Semantics())->analyze('set role r1, r2')->toString() // => 'SET ROLE r1, r2'

Properties§

public RoleSelection $roles

Methods§

public function __construct(public RoleSelection $roles)

Parameters

$rolesRoleSelectionThe roles to activate
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 1

Test cases 2§

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

Dedicated tests 1
Other tests reaching this symbol 1

Relations§

Instantiated in 4