classGrantAs
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.
$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::DefaultProperties§
public Account $userpublic RoleSelection|null $roles = nullMethods§
public function __construct(public Account $user, public RoleSelection|null $roles = null)Parameters
$user | Account | The account |
$roles | RoleSelection|null | The roles of WITH ROLE, when written |
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
GrantAsTestcalls