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.

Reading an overlay without a countdoctest
$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 $string
public Scalar $replacement
public Scalar $start
public Scalar|null $count = null

Methods§

public function __construct(
    public Scalar $string,
    public Scalar $replacement,
    public Scalar $start,
    public Scalar|null $count = null,
)

Parameters

$stringScalarThe string changed
$replacementScalarThe string placed
$startScalarThe position of the first character replaced
$countScalar|nullThe number of characters replaced; the length of the replacement when null
public function outputName(): Name

Names an unaliased result column after the function the server calls.

Returns

Test cases 1
Calls 1
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives the operands and the result of pg_catalog.overlay.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

Calls 3
public function render(Output $out): void

Writes OVERLAY with its keywords.

Parameters

$outOutput
Test cases 1
Calls 2

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 1
Type declarations 1