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

A request to define how a type is passed to and from a procedural language.

Rule: PG-TRANSFORM-001. Mirrors CreateTransformStmt: replace, type, language and one function per direction, kept in the order written. Source: https://www.postgresql.org/docs/17/sql-createtransform.html. Status: Implemented.

Reading the language of a transformdoctest
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('CREATE OR REPLACE TRANSFORM FOR hstore LANGUAGE plpython3u (FROM SQL WITH FUNCTION a(internal), TO SQL WITH FUNCTION b(internal))');
    [$operation->statement->language->value, count($operation->statement->functions)] // => ['plpython3u', 2]

Properties§

public non-empty-list<TransformFunction> $functions
public bool $orReplace
public TypeName $type
public Name $language

Methods§

public function __construct(
    public bool $orReplace,
    public TypeName $type,
    public Name $language,
    list<TransformFunction> $functions,
)

Parameters

$orReplaceboolWhether OR REPLACE is written
$typeTypeNameThe type
$languageNameThe language
$functionslist<TransformFunction>One or two functions of different directions, in the order written
Calls 4
public function deriveStatement(Derivation $derivation): void

Derives the type name and the function signatures.

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 2

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