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.

Reading a column privilegedoctest
$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> $columns

Methods§

public function __construct(public PrivilegeKind $kind, list<Name> $columns = [])

Parameters

$kindPrivilegeKindThe privilege
$columnslist<Name>The columns the privilege is limited to; none for the whole object
Calls 4
public function render(Output $out): void

Writes the privilege and its column list.

Parameters

$outOutput
Calls 5

Test cases 3§

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 2

Relations§

Instantiated in 1
Type checks 5
Type declarations 1