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

A window specification: an optional base window, a partition, an ordering and a frame.

Source: https://sqlite.org/windowfunctions.html#window_chaining.

Reading the parts of a windowdoctest
$query = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('SELECT rank() OVER (w PARTITION BY a ORDER BY b) FROM t WINDOW w AS ()');
    $window = $query->statement->columns[0]->expression->over;
    [$window->base->value, count($window->partition), count($window->order)] // => ['w', 1, 1]

Properties§

public list<Scalar> $partition
public list<SortTerm> $order
public Name|null $base = null
public Frame|null $frame = null

Methods§

public function __construct(
    public Name|null $base = null,
    list<Scalar> $partition = [],
    list<SortTerm> $order = [],
    public Frame|null $frame = null,
)

Parameters

$baseName|nullThe window this one extends
$partitionlist<Scalar>The partitioning expressions
$orderlist<SortTerm>The ordering terms
$frameFrame|nullThe frame
Calls 3
public function expressions(): list<Scalar>

Answers every expression of the window in written order.

Returns

list<Scalar>
Test cases 1
public function render(Output $out): void

Writes the specification without its parentheses.

Parameters

$outOutput
Calls 4

Test cases 20§

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

Dedicated tests 4
Other tests reaching this symbol 16

Relations§

Instantiated in 6
Type checks 1
Type declarations 4