final class Overlaps
    implements Scalar
    uses Snapshot
Public API: explicitly declared with @visibility public.

A test of whether two time periods overlap: (start1, end1) OVERLAPS (start2, end2).

The parser reads it as a call of pg_catalog.overlaps with the four fields; each period is a start and an end, or a start and a length.

Rule: PG-OVERLAPS-001. Facts: boolean, NULL when a field can be (a row constructor itself is never NULL, so its fields decide); a period of other than two fields is reported, as the parser rejects it. Source: https://www.postgresql.org/docs/17/functions-datetime.html. Status: Implemented.

Testing two periodsdoctest
(new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze("SELECT (date '2024-01-01', date '2024-02-01') OVERLAPS (date '2024-01-15', interval '1 day')")->field(0)->type->descriptor->name() // => 'boolean'

Properties§

Methods§

public function __construct(public RowConstructor $left, public RowConstructor $right)

Parameters

$leftRowConstructorThe first period
$rightRowConstructorThe second period
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives both periods and checks that each has two fields.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

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

Writes the two periods around OVERLAPS.

Parameters

$outOutput
Test cases 1
Calls 1

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 checks 1