classCreateLanguage
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.
$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 $orReplacepublic bool $trustedpublic Name $namepublic DottedName $handlerpublic DottedName|null $inline = nullpublic FunctionClause|null $validator = nullMethods§
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
$orReplace | bool | Whether OR REPLACE is written |
$trusted | bool | Whether TRUSTED is written |
$name | Name | The language name |
$handler | DottedName | The call handler |
$inline | DottedName|null | The inline handler, when INLINE is written |
$validator | FunctionClause|null | The VALIDATOR or NO VALIDATOR clause, when written |
Calls 2
- static-call Check::input() line 49
- class-const FunctionRole::Validator() line 49
public function deriveStatement(Derivation $derivation): voidDerives nothing: the handler functions are not part of a declaration context.
Parameters
$derivation | Derivation |
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 3
- method-call Output::keyword() line 64
- class-const NameUse::Column() line 71
- method-call Output::node() line 75
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.