final class FrameBound
    implements Node
    uses Snapshot
Public API: explicitly declared with @visibility public.

One boundary of a window frame.

Reading the offset of a frame boundarydoctest
$query = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('SELECT sum(a) OVER (ROWS 2 PRECEDING) FROM t');
    $query->statement->columns[0]->expression->over->frame->start->offset->digits // => '2'
Refusing an offset on a boundary that takes nonedoctest
new \SqlSemantics\Platform\Sqlite\Statement\Expression\Window\FrameBound(\SqlSemantics\Platform\Sqlite\Statement\Expression\Window\FrameBoundKind::CurrentRow, new \SqlSemantics\Platform\Sqlite\Statement\Expression\Literal\IntegerLiteral('1')) // throws \SqlSemantics\Platform\Sqlite\Model\Diagnostic\InvalidConstruction
Refusing an offset on unbounded precedingdoctest
new \SqlSemantics\Platform\Sqlite\Statement\Expression\Window\FrameBound(\SqlSemantics\Platform\Sqlite\Statement\Expression\Window\FrameBoundKind::UnboundedPreceding, new \SqlSemantics\Platform\Sqlite\Statement\Expression\Literal\IntegerLiteral('1')) // throws \SqlSemantics\Platform\Sqlite\Model\Diagnostic\InvalidConstruction
Refusing preceding without an offsetdoctest
new \SqlSemantics\Platform\Sqlite\Statement\Expression\Window\FrameBound(\SqlSemantics\Platform\Sqlite\Statement\Expression\Window\FrameBoundKind::Preceding) // throws \SqlSemantics\Platform\Sqlite\Model\Diagnostic\InvalidConstruction

Properties§

public Scalar|null $offset = null

Methods§

public function __construct(public FrameBoundKind $kind, public Scalar|null $offset = null)

Parameters

$kindFrameBoundKindThe kind of boundary
$offsetScalar|nullThe distance from the current row; present exactly for PRECEDING and FOLLOWING with an expression
Calls 3
public function render(Output $out): void

Test cases 5§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1
Other tests reaching this symbol 4

Relations§

Instantiated in 4
Type declarations 2