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

The GRANT action of ALTER DEFAULT PRIVILEGES: privileges future objects of a kind receive.

Mirrors the GrantStmt of DefACLAction with the target type ACL_TARGET_DEFAULTS: the privileges (an empty list is ALL PRIVILEGES), the kind of object, the grantees and WITH GRANT OPTION. Source: https://www.postgresql.org/docs/17/sql-alterdefaultprivileges.html.

Reading a default grantdoctest
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER DEFAULT PRIVILEGES GRANT insert ON TABLES TO joe WITH GRANT OPTION');
    [$operation->statement->action->objects->value, $operation->statement->action->grantOption] // => ['TABLES', true]

Properties§

public list<Privilege> $privileges
public non-empty-list<RoleSpec> $grantees
public bool $grantOption = false

Methods§

public function __construct(
    list<Privilege> $privileges,
    public DefaultObjectKind $objects,
    list<RoleSpec> $grantees,
    public bool $grantOption = false,
)

Parameters

$privilegeslist<Privilege>The privileges in the order written; empty for ALL PRIVILEGES
$objectsDefaultObjectKindThe kind of object the defaults are set for
$granteeslist<RoleSpec>The grantees in the order written, at least one
$grantOptionboolWhether WITH GRANT OPTION is written
Calls 4
public function render(Output $out): void

Writes the action.

Parameters

$outOutput
Calls 3

Test cases 2§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 2

Relations§

Instantiated in 1
Type checks 1
Type declarations 3