final class GrantRule
Restricted visibility: declared "@visibility SqlSemantics\Platform\MySql". Code outside that scope must not name this declaration.

Lowers GRANT and REVOKE of MySQL 8.0 and later.

Rule: MYSQL-ACCOUNT-GRANT-001. Scope: grant, revoke (8.0+ productions), opt_with_admin_option, opt_ignore_unknown_user, opt_grant_as. Without an ON clause the list is a list of roles (PT_grant_roles, PT_revoke_roles); with one it is a list of privileges. A user_list account is an account specification without authentication. Constructs: GrantPrivileges, GrantRoles, GrantProxy, RevokePrivileges, RevokeAll, RevokeRoles, RevokeProxy, GrantAs. Terminates: every child is a strict subtree. Source: https://dev.mysql.com/doc/refman/8.4/en/grant.html, https://dev.mysql.com/doc/refman/8.4/en/revoke.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
Calls 1
public function revokeAll(Form $form, bool $ifExists, bool $ignore): RevokePrivileges
public function everything(Form $form, bool $ifExists, bool $ignore): RevokeAll

Lowers REVOKE ALL [PRIVILEGES], GRANT OPTION FROM … of 8.0.

Parameters

$formForm
$ifExistsbool
$ignorebool

Returns

Called from 1
Calls 4
public function specifications(Node $list): non-empty-list<UserSpecification>
public function admin(Node $option): bool

Lowers an opt_with_admin_option.

Parameters

$optionNode

Returns

bool

Throws

ImplementationGap When the production has no rule
Called from 1
Calls 2
public function ignore(Node $option): bool

Lowers an opt_ignore_unknown_user.

Parameters

$optionNode

Returns

bool

Throws

ImplementationGap When the production has no rule
Called from 1
Calls 2

Private surface 2§

Implementation details, listed for orientation only.

private PrivilegeRule $privileges
private Lowering $lowering

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 3
Method calls 3