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

AS user [WITH ROLE …] of GRANT (8.0.16+): the account and active roles whose privileges and partial revokes the grant is executed with.

Mirrors LEX_GRANT_AS. Source: https://dev.mysql.com/doc/refman/8.4/en/grant.html#grant-as.

Reading the account a grant is executed asdoctest
$as = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('GRANT SELECT ON *.* TO u AS admin WITH ROLE DEFAULT')->statement->as;
    $as?->roles?->set // => \SqlSemantics\Platform\MySql\Statement\Account\User\RoleSet::Default

Properties§

public Account $user
public RoleSelection|null $roles = null

Methods§

public function __construct(public Account $user, public RoleSelection|null $roles = null)

Parameters

$userAccountThe account
$rolesRoleSelection|nullThe roles of WITH ROLE, when written
public function render(Output $out): void

Writes the clause.

Parameters

$outOutput
Calls 1

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 1
Type declarations 2