classOverlay
final class Overlay
implements Scalar, OutputNaming
uses Snapshot
Public API: explicitly declared with
@visibility public.OVERLAY (string PLACING replacement FROM start [FOR count]): a substring replaced.
The server calls pg_catalog.overlay(string, replacement, start[, count]). Rule: PG-OVERLAY-001. Facts: those of the call (PG-CALL-RESULT-001; the type of the string for text, bytea and bit). The result column is named overlay. Source: https://www.postgresql.org/docs/17/functions-string.html. Status: Implemented.
$null = static fn () => new \SqlSemantics\Platform\PostgreSql\Statement\Literal\NullLiteral();
$overlay = new \SqlSemantics\Platform\PostgreSql\Statement\Invocation\Text\Overlay($null(), $null(), $null());
[$overlay->count, $overlay->outputName()->value] // => [null, 'overlay']Properties§
public Scalar $stringpublic Scalar $replacementpublic Scalar $startpublic Scalar|null $count = nullMethods§
public function __construct(
public Scalar $string,
public Scalar $replacement,
public Scalar $start,
public Scalar|null $count = null,
)Parameters
$string | Scalar | The string changed |
$replacement | Scalar | The string placed |
$start | Scalar | The position of the first character replaced |
$count | Scalar|null | The number of characters replaced; the length of the replacement when null |
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 operands and the result of pg_catalog.overlay.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 3
- method-call Derivation::scalar() line 59
- method-call CallTyping::catalog() line 64
- new CallTyping line 64
public function render(Output $out): voidWrites OVERLAY with its keywords.
Parameters
$out | Output |
Test cases 1
Calls 2
- method-call Output::keyword() line 72
- method-call Output::symbol() line 76
Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.