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

One bound of a window frame.

An offset that is the bare column unbounded is written quoted: the grammar reads an unquoted unbounded before PRECEDING or FOLLOWING as the keyword of an unbounded frame (%nonassoc UNBOUNDED in gram.y). Source: https://www.postgresql.org/docs/17/sql-expressions.html#SYNTAX-WINDOW-FUNCTIONS.

Reading an offset bounddoctest
$bound = new \SqlSemantics\Platform\PostgreSql\Statement\Invocation\FrameBound(
        \SqlSemantics\Platform\PostgreSql\Statement\Invocation\FrameBoundKind::OffsetPreceding,
        new \SqlSemantics\Platform\PostgreSql\Statement\Literal\Constant(new \SqlSemantics\Platform\PostgreSql\Statement\Literal\IntegerConstant('2')),
    );
    $bound->offset->value->digits // => '2'
Rejecting an offset on CURRENT ROWdoctest
new \SqlSemantics\Platform\PostgreSql\Statement\Invocation\FrameBound(\SqlSemantics\Platform\PostgreSql\Statement\Invocation\FrameBoundKind::CurrentRow, new \SqlSemantics\Platform\PostgreSql\Statement\Literal\NullLiteral()) // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\InvalidConstruction

Properties§

public Scalar|null $offset = null

Methods§

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

Parameters

$kindFrameBoundKindWhere the bound lies
$offsetScalar|nullThe offset expression; given exactly for the offset kinds
Calls 2
public function deriveClause(Derivation $derivation, Environment $environment): void
public function render(Output $out): void

Writes the offset and the keywords.

Parameters

$outOutput
Test cases 1
Calls 6

Test cases 14§

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

Dedicated tests 3
Other tests reaching this symbol 11

Relations§

Instantiated in 1
Method calls 1
Type declarations 3