classWindowRule
final class WindowRule
Lowers window specifications, frames and the WINDOW clause.
Rule: SQLITE-WINDOW-LOWER-001. Scope: window, frame_opt, range_or_rows, frame_bound_s, frame_bound_e, frame_bound, frame_exclude_opt, frame_exclude, window_clause, windowdefn_list, windowdefn. A window keeps its base window name, partition, ordering and frame as written. Terminates: lists are flattened iteratively; every part is a strict subtree. Source: https://sqlite.org/windowfunctions.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
public function window(Node $window): WindowSpecLowers a window specification.
Parameters
$window | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 3
- new WindowSpec line 53
- method-call WindowRule::frame() line 53
- static-call ImplementationGap::production() line 59
Lowers a frame_opt: the frame, or null when none is written.
Parameters
$frame | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 6
- method-call SqlSemantics\Platform\Sqlite\Lowering\Expression\WindowRule::window() packages/sql-semantics-sqlite/src/Lowering/Expression/WindowRule.php:53
- method-call SqlSemantics\Platform\Sqlite\Lowering\Expression\WindowRule::window() packages/sql-semantics-sqlite/src/Lowering/Expression/WindowRule.php:54
- method-call SqlSemantics\Platform\Sqlite\Lowering\Expression\WindowRule::window() packages/sql-semantics-sqlite/src/Lowering/Expression/WindowRule.php:55
- method-call SqlSemantics\Platform\Sqlite\Lowering\Expression\WindowRule::window() packages/sql-semantics-sqlite/src/Lowering/Expression/WindowRule.php:56
- method-call SqlSemantics\Platform\Sqlite\Lowering\Expression\WindowRule::window() packages/sql-semantics-sqlite/src/Lowering/Expression/WindowRule.php:57
- method-call SqlSemantics\Platform\Sqlite\Lowering\Expression\WindowRule::window() packages/sql-semantics-sqlite/src/Lowering/Expression/WindowRule.php:58
Calls 6
- static-call ImplementationGap::production() line 76
- static-call FrameUnit::from() line 78
- function-call
strtoupperline 78 - new Frame line 81
- method-call WindowRule::bound() line 81
- method-call WindowRule::exclusion() line 81
public function bound(Node $bound): FrameBoundLowers a frame boundary of any of the three boundary productions.
Parameters
$bound | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 3
- method-call SqlSemantics\Platform\Sqlite\Lowering\Expression\WindowRule::frame() packages/sql-semantics-sqlite/src/Lowering/Expression/WindowRule.php:81
- method-call SqlSemantics\Platform\Sqlite\Lowering\Expression\WindowRule::frame() packages/sql-semantics-sqlite/src/Lowering/Expression/WindowRule.php:82
- method-call SqlSemantics\Platform\Sqlite\Lowering\Expression\WindowRule::bound() packages/sql-semantics-sqlite/src/Lowering/Expression/WindowRule.php:97
Calls 8
- method-call WindowRule::bound() line 97
- new FrameBound line 98
- class-const FrameBoundKind::UnboundedPreceding() line 98
- class-const FrameBoundKind::UnboundedFollowing() line 99
- class-const FrameBoundKind::Preceding() line 100
- class-const FrameBoundKind::Following() line 100
- class-const FrameBoundKind::CurrentRow() line 101
- static-call ImplementationGap::production() line 102
public function exclusion(Node $clause): ?FrameExclusionLowers a frame_exclude_opt: the exclusion, or null when none is written.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 2
- method-call SqlSemantics\Platform\Sqlite\Lowering\Expression\WindowRule::frame() packages/sql-semantics-sqlite/src/Lowering/Expression/WindowRule.php:81
- method-call SqlSemantics\Platform\Sqlite\Lowering\Expression\WindowRule::frame() packages/sql-semantics-sqlite/src/Lowering/Expression/WindowRule.php:82
Calls 5
- static-call ImplementationGap::production() line 118
- class-const FrameExclusion::NoOthers() line 123
- class-const FrameExclusion::CurrentRow() line 124
- static-call FrameExclusion::from() line 125
- function-call
strtoupperline 125
public function definitions(Node $clause): list<WindowDefinition>Lowers a window_clause into its definitions in written order.
Parameters
$clause | Node |
Returns
list<WindowDefinition>Throws
ImplementationGap When a production has no ruleCalls 5
- static-call ImplementationGap::production() line 140
- method-call Lists::items() line 147
- new Lists line 147
- new WindowDefinition line 152
- method-call WindowRule::window() line 152
Private surface 1§
Implementation details, listed for orientation only.
private Lowering $loweringTest cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
WindowRuleTestcalls