classChangeOwner
final class ChangeOwner
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.ALTER kind object OWNER TO role: changes the owner of an object.
Mirrors PostgreSQL's AlterOwnerStmt. Source: https://www.postgresql.org/docs/17/sql-alterschema.html, https://www.postgresql.org/docs/17/sql-alterfunction.html.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER SCHEMA app OWNER TO CURRENT_USER');
$operation->statement->owner->kind->name // => 'CurrentUser'Properties§
public ObjectKind $kindpublic ObjectReference $objectpublic RoleSpec $ownerMethods§
public function __construct(
public ObjectKind $kind,
public ObjectReference $object,
public RoleSpec $owner,
)Parameters
$kind | ObjectKind | The kind of the object |
$object | ObjectReference | The object, named as OWNER TO names objects of the kind |
$owner | RoleSpec | The new owner |
Calls 5
- new ObjectForms line 41
- static-call Check::input() line 42
- function-call
in_arrayline 42 - method-call ObjectForms::form() line 42
- method-call ObjectForms::altered() line 42
public function deriveStatement(Derivation $derivation): voidDerives the object.
Parameters
$derivation | Derivation |
Calls 2
- method-call ObjectFacts::derive() line 50
- new ObjectFacts line 50
public function render(Output $out): voidWrites the statement.
Parameters
$out | Output |
Calls 4
- method-call Output::keyword() line 58
- method-call ObjectSpelling::kind() line 59
- new ObjectSpelling line 59
- method-call Output::node() line 60
Test cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.