final class AlterExtensionContents
    implements Statement
    uses Snapshot
Public API: explicitly declared with @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.

Reading the object added to an extensiondoctest
$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 $extension
public AddOrDrop $action
public ObjectKind $kind

Methods§

public function __construct(
    public Name $extension,
    public AddOrDrop $action,
    public ObjectKind $kind,
    public ObjectReference $object,
)

Parameters

$extensionNameThe extension name
$actionAddOrDropWhether the object is added or removed
$kindObjectKindThe kind of the object
$objectObjectReferenceThe object
Calls 3
public function deriveStatement(Derivation $derivation): void

Derives the object reference, which may name types with modifiers.

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 3

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
Type declarations 1