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

A request to define a procedural language with its handler functions.

Rule: PG-LANGUAGE-001. Mirrors CreatePLangStmt: replace, trusted, the language name, the call handler, the inline handler and the validator. The PROCEDURAL noise word is not kept. Source: https://www.postgresql.org/docs/17/sql-createlanguage.html. Status: Implemented.

Reading the handler of a new languagedoctest
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('CREATE TRUSTED LANGUAGE plsample HANDLER plsample_call_handler NO VALIDATOR');
    [$operation->statement->handler->last()->value, $operation->toString()] // => ['plsample_call_handler', 'CREATE TRUSTED LANGUAGE plsample HANDLER plsample_call_handler NO VALIDATOR']

Properties§

public bool $orReplace
public bool $trusted
public Name $name
public DottedName $handler
public DottedName|null $inline = null
public FunctionClause|null $validator = null

Methods§

public function __construct(
    public bool $orReplace,
    public bool $trusted,
    public Name $name,
    public DottedName $handler,
    public DottedName|null $inline = null,
    public FunctionClause|null $validator = null,
)

Parameters

$orReplaceboolWhether OR REPLACE is written
$trustedboolWhether TRUSTED is written
$nameNameThe language name
$handlerDottedNameThe call handler
$inlineDottedName|nullThe inline handler, when INLINE is written
$validatorFunctionClause|nullThe VALIDATOR or NO VALIDATOR clause, when written
Calls 2
public function deriveStatement(Derivation $derivation): void

Derives nothing: the handler functions are not part of a declaration context.

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 3

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 1