classFrameBound
final class FrameBound
implements Node
uses Snapshot
Public API: explicitly declared with
@visibility public.One boundary of a window frame.
$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'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\InvalidConstructionnew \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\InvalidConstructionnew \SqlSemantics\Platform\Sqlite\Statement\Expression\Window\FrameBound(\SqlSemantics\Platform\Sqlite\Statement\Expression\Window\FrameBoundKind::Preceding) // throws \SqlSemantics\Platform\Sqlite\Model\Diagnostic\InvalidConstructionProperties§
public FrameBoundKind $kindpublic Scalar|null $offset = nullMethods§
public function __construct(public FrameBoundKind $kind, public Scalar|null $offset = null)Parameters
$kind | FrameBoundKind | The kind of boundary |
$offset | Scalar|null | The distance from the current row; present exactly for PRECEDING and FOLLOWING with an expression |
Calls 3
- static-call Check::input() line 37
- class-const FrameBoundKind::Preceding() line 37
- class-const FrameBoundKind::Following() line 37
public function render(Output $out): voidWrites the boundary.
Parameters
$out | Output |
Calls 7
- method-call Output::node() line 45
- class-const FrameBoundKind::UnboundedPreceding() line 47
- method-call Output::keyword() line 47
- class-const FrameBoundKind::Preceding() line 48
- class-const FrameBoundKind::CurrentRow() line 49
- class-const FrameBoundKind::Following() line 50
- class-const FrameBoundKind::UnboundedFollowing() line 51
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
- new SqlSemantics\Platform\Sqlite\Lowering\Expression\WindowRule::bound() packages/sql-semantics-sqlite/src/Lowering/Expression/WindowRule.php:98
- new SqlSemantics\Platform\Sqlite\Lowering\Expression\WindowRule::bound() packages/sql-semantics-sqlite/src/Lowering/Expression/WindowRule.php:99
- new SqlSemantics\Platform\Sqlite\Lowering\Expression\WindowRule::bound() packages/sql-semantics-sqlite/src/Lowering/Expression/WindowRule.php:100
- new SqlSemantics\Platform\Sqlite\Lowering\Expression\WindowRule::bound() packages/sql-semantics-sqlite/src/Lowering/Expression/WindowRule.php:101