classAlterDefaultPrivileges
final class AlterDefaultPrivileges
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.A request to change the privileges that objects created in the future receive.
Rule: PG-DEFAULT-PRIVILEGES-001. Mirrors AlterDefaultPrivilegesStmt: the limiting clauses in the order written and one GRANT or REVOKE action. Reported (PG-DEFAULT-PRIVILEGES-CHECK-001): a limiting clause given twice, a column list, a privilege that does not apply to the kind of object, IN SCHEMA together with ON SCHEMAS, PUBLIC as a role of FOR ROLE and a grant option for PUBLIC. Source: https://www.postgresql.org/docs/17/sql-alterdefaultprivileges.html. Status: Implemented.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER DEFAULT PRIVILEGES IN SCHEMA app GRANT SELECT ON TABLES TO PUBLIC');
[$operation->statement->scopes[0]->option(), $operation->statement->action->objects->value] // => ['schemas', 'TABLES']Properties§
public list<DefaultScope> $scopespublic DefaultGrant|DefaultRevoke $actionMethods§
public function __construct(
list<DefaultScope> $scopes,
public DefaultGrant|DefaultRevoke $action,
)Parameters
$scopes | list<DefaultScope> | The limiting clauses in the order written |
$action | DefaultGrant|DefaultRevoke | The GRANT or REVOKE action |
Calls 2
- static-call Check::listOf() line 45
- class-const DefaultScope::class() line 45
public function deriveStatement(Derivation $derivation): voidReports the problems of the clauses and of the action.
Parameters
$derivation | Derivation |
Calls 2
- method-call DefaultPrivilegeChecks::check() line 53
- new DefaultPrivilegeChecks line 53
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 61
- method-call Output::node() line 63
Test cases 4§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.