classNormalize
final class Normalize
implements Scalar, OutputNaming
uses Snapshot
Public API: explicitly declared with
@visibility public.NORMALIZE (value [, form]): a string converted to a Unicode normal form.
The server calls pg_catalog.normalize(value[, 'form']); without a form the function's default NFC applies, but the form written is kept. Rule: PG-NORMALIZE-001. Facts: those of the call (PG-CALL-RESULT-001, the form passed as a text constant). The result column is named normalize. Source: https://www.postgresql.org/docs/17/functions-string.html. Status: Implemented.
$normalize = new \SqlSemantics\Platform\PostgreSql\Statement\Invocation\Syntax\Normalize(new \SqlSemantics\Platform\PostgreSql\Statement\Literal\NullLiteral(), \SqlSemantics\Platform\PostgreSql\Statement\Option\NormalForm::Nfkc);
[$normalize->form->value, $normalize->outputName()->value] // => ['NFKC', 'normalize']Properties§
public Scalar $valuepublic NormalForm|null $form = nullMethods§
public function __construct(public Scalar $value, public NormalForm|null $form = null)Parameters
$value | Scalar | The string normalized |
$form | NormalForm|null | The normal form written |
public function outputName(): NameNames an unaliased result column after the function the server calls.
Returns
Test cases 1
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFactDerives the value and the result of pg_catalog.normalize.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 7
- method-call Derivation::scalar() line 60
- new ScalarFact line 62
- new Known line 62
- class-const Builtin::Unknown() line 62
- class-const Nullability::NotNull() line 62
- method-call CallTyping::catalog() line 65
- new CallTyping line 65
public function render(Output $out): voidWrites NORMALIZE with the value and the form.
Parameters
$out | Output |
Test cases 1
Calls 2
- method-call Output::keyword() line 73
- method-call Output::symbol() line 75
Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 3
Relations§
Instantiated in 2
- new SqlSemantics\Platform\PostgreSql\Lowering\Invocation\SyntaxRule::special() packages/sql-semantics-postgres/src/Lowering/Invocation/SyntaxRule.php:114
- new SqlSemantics\Platform\PostgreSql\Lowering\Invocation\SyntaxRule::special() packages/sql-semantics-postgres/src/Lowering/Invocation/SyntaxRule.php:115