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.

Reading the roles and the behaviordoctest
$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> $roles
public DropBehavior|null $behavior = null

Methods§

public function __construct(list<RoleSpec> $roles, public DropBehavior|null $behavior = null)

Parameters

$roleslist<RoleSpec>The roles in the order written, at least one
$behaviorDropBehavior|nullCASCADE or RESTRICT, when written
Calls 2
public function deriveStatement(Derivation $derivation): void

Reports PUBLIC among the roles.

Parameters

$derivationDerivation
Calls 2
public function render(Output $out): void

Writes the request.

Parameters

$outOutput
Calls 1

Test cases 2§

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 1

Relations§

Instantiated in 1