classStaticPrivilege
final class StaticPrivilege
implements Grantable
uses Snapshot
Public API: explicitly declared with
@visibility public.A privilege the server defines statically, such as SELECT (a, b) or CREATE ROUTINE, with its column list.
Mirrors PT_static_privilege. Only SELECT, INSERT, UPDATE and REFERENCES take a column list; the columns are kept as written. Source: https://dev.mysql.com/doc/refman/8.4/en/grant.html#grant-column-privileges.
$privilege = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('GRANT SELECT (a, b) ON t TO u')->statement->privileges[0];
[$privilege->kind, count($privilege->columns)] // => [\SqlSemantics\Platform\MySql\Statement\Account\Privilege\Item\PrivilegeKind::Select, 2]Properties§
public list<Name> $columnspublic PrivilegeKind $kindMethods§
public function __construct(public PrivilegeKind $kind, list<Name> $columns = [])Parameters
$kind | PrivilegeKind | The privilege |
$columns | list<Name> | The columns the privilege is limited to; none for the whole object |
Calls 4
- static-call Check::listOf() line 40
- class-const Name::class() line 40
- static-call Check::input() line 41
- method-call PrivilegeKind::columns() line 41
public function render(Output $out): voidWrites the privilege and its column list.
Parameters
$out | Output |
Calls 5
- method-call Output::keyword() line 49
- method-call PrivilegeKind::words() line 49
- method-call Output::symbol() line 51
- method-call Output::name() line 56
- class-const NameUse::Column() line 56
Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
StaticPrivilegeTestcalls
Other tests reaching this symbol 2
Relations§
Instantiated in 1
Type checks 5
- instanceof SqlSemantics\Platform\MySql\Rules\Account\PrivilegeChecks::grant() packages/sql-semantics-mysql/src/Rules/Account/PrivilegeChecks.php:76
- instanceof SqlSemantics\Platform\MySql\Rules\Account\PrivilegeChecks::grant() packages/sql-semantics-mysql/src/Rules/Account/PrivilegeChecks.php:77
- instanceof SqlSemantics\Platform\MySql\Rules\Account\PrivilegeChecks::grant() packages/sql-semantics-mysql/src/Rules/Account/PrivilegeChecks.php:82
- instanceof SqlSemantics\Platform\MySql\Rules\Account\PrivilegeChecks::level() packages/sql-semantics-mysql/src/Rules/Account/PrivilegeChecks.php:121
- instanceof SqlSemantics\Platform\MySql\Rules\Account\PrivilegeChecks::describe() packages/sql-semantics-mysql/src/Rules/Account/PrivilegeChecks.php:198