classCreateTransform
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.
$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> $functionspublic bool $orReplacepublic TypeName $typepublic Name $languageMethods§
public function __construct(
public bool $orReplace,
public TypeName $type,
public Name $language,
list<TransformFunction> $functions,
)Parameters
$orReplace | bool | Whether OR REPLACE is written |
$type | TypeName | The type |
$language | Name | The language |
$functions | list<TransformFunction> | One or two functions of different directions, in the order written |
Calls 4
- static-call Check::listOf() line 46
- class-const TransformFunction::class() line 46
- static-call Check::input() line 47
- function-call
countline 47
public function deriveStatement(Derivation $derivation): voidDerives the type name and the function signatures.
Parameters
$derivation | Derivation |
Calls 2
- method-call ClauseFacts::derive() line 55
- new ClauseFacts line 55
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 63
- class-const NameUse::Column() line 67
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
CreateTransformTestcalls