classAlterExtensionContents
final class AlterExtensionContents
implements Statement
uses Snapshot
@visibility public.A request to add an object to an extension or to remove it from the extension.
Rule: PG-EXTENSION-003. Mirrors AlterExtensionContentsStmt: action, object kind and object. The object is referenced in the form its kind takes: a name, a dotted name, a type, a cast, a routine or operator signature, an operator class or family with its access method, or a transform. Objects of a kind ALTER EXTENSION cannot address are rejected. Source: https://www.postgresql.org/docs/17/sql-alterextension.html. Status: Implemented.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER EXTENSION hstore ADD SCHEMA s');
[$operation->statement->action, $operation->statement->kind] // => [\SqlSemantics\Platform\PostgreSql\Statement\Option\AddOrDrop::Add, \SqlSemantics\Platform\PostgreSql\Statement\Name\ObjectKind::Schema]Properties§
public Name $extensionpublic AddOrDrop $actionpublic ObjectKind $kindpublic ObjectReference $objectMethods§
public function __construct(
public Name $extension,
public AddOrDrop $action,
public ObjectKind $kind,
public ObjectReference $object,
)Parameters
$extension | Name | The extension name |
$action | AddOrDrop | Whether the object is added or removed |
$kind | ObjectKind | The kind of the object |
$object | ObjectReference | The object |
Calls 3
- static-call Check::input() line 60
- function-call
in_arrayline 60 - class-const AlterExtensionContents::KINDS() line 60
public function deriveStatement(Derivation $derivation): voidDerives the object reference, which may name types with modifiers.
Parameters
$derivation | Derivation |
Calls 4
- method-call ClauseFacts::derive() line 68
- new ClauseFacts line 68
- method-call RelationKinds::named() line 69
- new RelationKinds line 69
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 3
- method-call Output::keyword() line 77
- class-const NameUse::Column() line 77
- method-call ObjectKind::keywords() line 77
Private surface 1§
Implementation details, listed for orientation only.
private const KINDS = [\SqlSemantics\Platform\PostgreSql\Statement\Name\ObjectKind::AccessMethod, \Sq…Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
Relations§
Instantiated in 3
- new SqlSemantics\Platform\PostgreSql\Lowering\Catalog\ExtensionRule::contents() packages/sql-semantics-postgres/src/Lowering/Catalog/ExtensionRule.php:124
- new SqlSemantics\Platform\PostgreSql\Lowering\Catalog\ExtensionRule::contents() packages/sql-semantics-postgres/src/Lowering/Catalog/ExtensionRule.php:127
- new SqlSemantics\Platform\PostgreSql\Lowering\Catalog\ExtensionRule::contents() packages/sql-semantics-postgres/src/Lowering/Catalog/ExtensionRule.php:144