classDropOwned
final class DropOwned
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.A request to drop every object of the current database that the given roles own and to revoke their privileges.
Rule: PG-OWNED-DROP-001. Mirrors DropOwnedStmt: the roles and CASCADE or RESTRICT as written. Which objects the roles own is known when the statement runs, so no relation is resolved. Reported: PUBLIC, which is not a role. Source: https://www.postgresql.org/docs/17/sql-drop-owned.html. Status: Implemented.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('DROP OWNED BY joe, CURRENT_USER CASCADE');
[count($operation->statement->roles), $operation->statement->behavior?->value] // => [2, 'CASCADE']Properties§
public non-empty-list<RoleSpec> $rolespublic DropBehavior|null $behavior = nullMethods§
public function __construct(list<RoleSpec> $roles, public DropBehavior|null $behavior = null)Parameters
$roles | list<RoleSpec> | The roles in the order written, at least one |
$behavior | DropBehavior|null | CASCADE or RESTRICT, when written |
Calls 2
- static-call Check::listOf() line 45
- class-const RoleSpec::class() line 45
public function deriveStatement(Derivation $derivation): voidReports PUBLIC among the roles.
Parameters
$derivation | Derivation |
Calls 2
- method-call RoleChecks::existing() line 53
- new RoleChecks line 53
public function render(Output $out): voidTest cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.