classSchemaContentsTarget
final class SchemaContentsTarget
implements PrivilegeTarget
uses Snapshot
Public API: explicitly declared with
@visibility public.Every object of one kind in the named schemas as the objects of a GRANT or REVOKE, such as ALL TABLES IN SCHEMA.
Mirrors the target type ACL_TARGET_ALL_IN_SCHEMA. Which objects the schemas hold is known when the statement runs, so nothing is resolved. Source: https://www.postgresql.org/docs/17/sql-grant.html.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('GRANT SELECT ON ALL TABLES IN SCHEMA app TO joe');
[$operation->statement->target->object()->value, $operation->statement->target->schemas[0]->value] // => ['TABLE', 'app']Constants§
public const KINDS = [\SqlSemantics\Platform\PostgreSql\Statement\Catalog\Access\Target\PrivilegeObj…The kinds that can be granted for whole schemas.
Properties§
public non-empty-list<Name> $schemaspublic PrivilegeObjectKind $objectMethods§
public function __construct(public PrivilegeObjectKind $object, list<Name> $schemas)Parameters
$object | PrivilegeObjectKind | The kind: tables, sequences, functions, procedures or routines |
$schemas | list<Name> | The schemas in the order written, at least one |
Calls 5
- static-call Check::input() line 46
- function-call
in_arrayline 46 - class-const SchemaContentsTarget::KINDS() line 46
- static-call Check::listOf() line 47
- class-const Name::class() line 47
public function object(): PrivilegeObjectKindAnswers the kind of the objects.
Returns
Test cases 1
public function deriveTarget(Derivation $derivation, array $privileges): voidDerives nothing: the objects of the schemas are known when the statement runs.
Parameters
$derivation | Derivation | |
$privileges | array |
public function render(Output $out): voidWrites ALL, the plural of the kind, IN SCHEMA and the schemas.
Parameters
$out | Output |
Calls 4
- method-call Output::keyword() line 70
- method-call Output::symbol() line 73
- method-call Output::name() line 75
- class-const NameUse::Column() line 75
Test cases 4§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.