classFrameBound
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.
$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'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\InvalidConstructionProperties§
public FrameBoundKind $kindpublic Scalar|null $offset = nullMethods§
public function __construct(public FrameBoundKind $kind, public Scalar|null $offset = null)Parameters
$kind | FrameBoundKind | Where the bound lies |
$offset | Scalar|null | The offset expression; given exactly for the offset kinds |
Calls 2
- static-call Check::input() line 45
- method-call FrameBoundKind::offset() line 45
public function deriveClause(Derivation $derivation, Environment $environment): voidDerives the offset expression.
Parameters
$derivation | Derivation | |
$environment | Environment |
Test cases 1
Called from 1
Calls 1
- method-call Derivation::scalar() line 54
public function render(Output $out): voidWrites the offset and the keywords.
Parameters
$out | Output |
Test cases 1
Calls 6
- function-call
countline 64 - method-call Output::name() line 65
- class-const NameUse::Identifier() line 65
- method-call Output::node() line 67
- method-call Output::keyword() line 69
- function-call
explodeline 69
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
WindowChecksTest::testSpecificationLeavesARefinedWindowToTheWindowClausecallsWindowChecksTest::testSpecificationReportsARangeOffsetWithoutASingleOrderingcallsWindowChecksTest::testSpecificationReportsGroupsWithoutOrderingcallsWindowFrameTest::testDeriveClauseDerivesTheOffsetsOfBothBoundscallsWindowFrameTest::testRejectsAnEndAtUnboundedPrecedingcallsWindowFrameTest::testRejectsAStartAfterTheCurrentRowWithoutAnEndcallsWindowFrameTest::testRenderWritesAStartAlonecallsWindowFrameTest::testRenderWritesBetweenForTwoBoundscallsWindowSpecificationTest::testDeriveClauseDerivesPartitionOrderAndFramecallsWindowSpecificationTest::testDeriveClauseReportsAFrameTheOrderingCannotSupportcallsWindowSpecificationTest::testRenderWritesTheSpecificationInParenthesescalls
Relations§
Instantiated in 1
Method calls 1
Type declarations 3
- type SqlSemantics\Platform\PostgreSql\Lowering\Invocation\WindowRule packages/sql-semantics-postgres/src/Lowering/Invocation/WindowRule.php:175
- type SqlSemantics\Platform\PostgreSql\Statement\Invocation\WindowFrame packages/sql-semantics-postgres/src/Statement/Invocation/WindowFrame.php:49
- type SqlSemantics\Platform\PostgreSql\Statement\Invocation\WindowFrame packages/sql-semantics-postgres/src/Statement/Invocation/WindowFrame.php:50