final class AlterRoutine
    implements Statement
    uses Snapshot
Public API: explicitly declared with @visibility public.

ALTER FUNCTION, PROCEDURE or ROUTINE ... action ...: changes options of a routine.

Mirrors PostgreSQL's AlterFunctionStmt. Only the options that CREATE and ALTER share can be changed; the optional trailing RESTRICT is ignored by the server and not kept. Source: https://www.postgresql.org/docs/17/sql-alterfunction.html.

Reading the altered routinedoctest
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER FUNCTION f(int4) IMMUTABLE');
    [$operation->statement->kind->value, $operation->statement->signature->name->last()->value] // => ['FUNCTION', 'f']

Properties§

public non-empty-list<RoutineOption> $options
public ObjectKind $kind
public RoutineSignature $signature

Methods§

public function __construct(
    public ObjectKind $kind,
    public RoutineSignature $signature,
    list<RoutineOption> $options,
)

Parameters

$kindObjectKindFUNCTION, PROCEDURE or ROUTINE
$signatureRoutineSignatureThe routine
$optionslist<RoutineOption>The changed options; at least one, each one CREATE and ALTER share
Calls 7
public function deriveStatement(Derivation $derivation): void

Derives the signature and the options and reports options the server rejects.

Parameters

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

Writes the statement.

Parameters

$outOutput
Calls 3

Test cases 3§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 2
Other tests reaching this symbol 1

Relations§

Instantiated in 1
Type declarations 1