classCreateConversion
final class CreateConversion
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.A request to define a conversion between two character set encodings.
Rule: PG-CONVERSION-001. Mirrors CreateConversionStmt: whether it is the default conversion, name, source and destination encodings and function. Source: https://www.postgresql.org/docs/17/sql-createconversion.html. Status: Implemented.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze("CREATE DEFAULT CONVERSION myconv FOR 'UTF8' TO 'LATIN1' FROM myfunc");
[$operation->statement->isDefault, $operation->statement->source->value, $operation->statement->target->value] // => [true, 'UTF8', 'LATIN1']Properties§
public bool $isDefaultpublic DottedName $namepublic StringConstant $sourcepublic StringConstant $targetpublic DottedName $functionMethods§
public function __construct(
public bool $isDefault,
public DottedName $name,
public StringConstant $source,
public StringConstant $target,
public DottedName $function,
)Parameters
$isDefault | bool | Whether DEFAULT is written |
$name | DottedName | The conversion name |
$source | StringConstant | The source encoding |
$target | StringConstant | The destination encoding |
$function | DottedName | The conversion function |
public function deriveStatement(Derivation $derivation): voidDerives nothing: conversions and their functions are not part of a declaration context.
Parameters
$derivation | Derivation |
public function render(Output $out): voidTest cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
CreateConversionTestcalls