classSetSchema
final class SetSchema
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.ALTER kind object SET SCHEMA schema: moves an object to another schema.
Mirrors PostgreSQL's AlterObjectSchemaStmt. A moved relation is resolved; the move changes no declaration of the context. Source: https://www.postgresql.org/docs/17/sql-altertable.html, https://www.postgresql.org/docs/17/sql-alterfunction.html.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER EXTENSION hstore SET SCHEMA util');
$operation->statement->schema->value // => 'util'Properties§
public ObjectKind $kindpublic ObjectReference $objectpublic Name $schemapublic bool $ifExists = falseMethods§
public function __construct(
public ObjectKind $kind,
public ObjectReference $object,
public Name $schema,
public bool $ifExists = false,
)Parameters
$kind | ObjectKind | The kind of the object |
$object | ObjectReference | The object, named as SET SCHEMA names objects of the kind |
$schema | Name | The new schema |
$ifExists | bool | Whether IF EXISTS is written; for relations only |
Calls 6
- new ObjectForms line 45
- static-call Check::input() line 46
- function-call
in_arrayline 46 - method-call ObjectForms::form() line 46
- method-call ObjectForms::altered() line 46
- class-const ObjectForms::ALTERED_RELATION() line 47
public function deriveStatement(Derivation $derivation): voidDerives the object.
Parameters
$derivation | Derivation |
Calls 4
- method-call ObjectFacts::derive() line 55
- new ObjectFacts line 55
- method-call RelationKinds::renamed() line 56
- new RelationKinds line 56
public function render(Output $out): voidWrites the statement.
Parameters
$out | Output |
Calls 5
- method-call Output::keyword() line 64
- method-call ObjectSpelling::kind() line 65
- new ObjectSpelling line 65
- method-call Output::node() line 69
- class-const NameUse::Column() line 69
Test cases 4§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.