final class RoutineDefinition
    implements RoutineOption
    uses Snapshot
Public API: explicitly declared with @visibility public.

AS 'definition' or AS 'object_file', 'link_symbol': the routine's definition as unanalysed text of its language.

The source is the text with the language it is written in, which the server passes to that language without parsing it as SQL (PG-ROUTINE-SOURCE-001); for a C function it names the shared library and the symbol follows it. Source: https://www.postgresql.org/docs/17/sql-createfunction.html.

Reading a string bodydoctest
$option = new \SqlSemantics\Platform\PostgreSql\Statement\Routine\Option\RoutineDefinition(new \SqlSemantics\Platform\PostgreSql\Statement\Routine\Option\RoutineSource(new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('sql'), new \SqlSemantics\Platform\PostgreSql\Statement\Literal\StringConstant('SELECT 1')));
    [$option->source->language?->value, $option->source->text->value, $option->symbol] // => ['sql', 'SELECT 1', null]

Properties§

public RoutineSource $source
public StringConstant|null $symbol = null

Methods§

public function __construct(
    public RoutineSource $source,
    public StringConstant|null $symbol = null,
)

Parameters

$sourceRoutineSourceThe definition in its language, or the object file of a C function
$symbolStringConstant|nullThe link symbol of a C function, if written
public function alterable(): bool

Tells that ALTER does not accept the option.

Returns

bool
Test cases 1
public function setting(): string

Answers as.

Returns

string
Test cases 1
public function deriveClause(Derivation $derivation, Environment $environment): void

Derives nothing: unanalysed text holds no expression.

Parameters

$derivationDerivation
$environmentEnvironment
Test cases 1
public function render(Output $out): void

Writes AS and the strings.

Parameters

$outOutput
Test cases 1
Calls 2

Test cases 7§

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

Dedicated tests 4
Other tests reaching this symbol 3

Relations§

Instantiated in 2
Type checks 3
Type declarations 1