classAlterRoutine
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.
$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> $optionspublic ObjectKind $kindpublic RoutineSignature $signatureMethods§
public function __construct(
public ObjectKind $kind,
public RoutineSignature $signature,
list<RoutineOption> $options,
)Parameters
$kind | ObjectKind | FUNCTION, PROCEDURE or ROUTINE |
$signature | RoutineSignature | The routine |
$options | list<RoutineOption> | The changed options; at least one, each one CREATE and ALTER share |
Calls 7
- static-call Check::input() line 46
- function-call
in_arrayline 46 - class-const ObjectKind::Function() line 46
- class-const ObjectKind::Procedure() line 46
- class-const ObjectKind::Routine() line 46
- static-call Check::listOf() line 47
- class-const RoutineOption::class() line 47
public function deriveStatement(Derivation $derivation): voidDerives the signature and the options and reports options the server rejects.
Parameters
$derivation | Derivation |
Calls 5
- method-call Derivation::environment() line 58
- method-call RoutineSignature::deriveClause() line 59
- method-call RoutineChecks::options() line 63
- new RoutineChecks line 63
- class-const ObjectKind::Procedure() line 63
public function render(Output $out): voidWrites the statement.
Parameters
$out | Output |
Calls 3
- method-call Output::keyword() line 71
- method-call ObjectKind::keywords() line 71
- method-call Output::node() line 73
Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.