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

A window specification in parentheses: an existing window to refine, a partition, an ordering and a frame.

Mirrors PostgreSQL's WindowDef node. It is written after OVER and in the WINDOW clause; the holder derives it in the environment of the query level it belongs to; a frame its own ordering cannot support is reported (PG-WINDOW-CHECKS-001). An existing window named partition, range, rows or groups is written quoted: gram.y reads that word as the keyword after the opening parenthesis (opt_existing_window_name, %prec Op). Source: https://www.postgresql.org/docs/17/sql-expressions.html#SYNTAX-WINDOW-FUNCTIONS, https://www.postgresql.org/docs/17/sql-select.html#SQL-WINDOW.

Reading an empty window specificationdoctest
$window = new \SqlSemantics\Platform\PostgreSql\Statement\Invocation\WindowSpecification();
    [$window->existing, $window->partition, $window->order, $window->frame] // => [null, [], [], null]

Properties§

public list<Scalar> $partition
public list<SortItem> $order
public Name|null $existing = null
public WindowFrame|null $frame = null

Methods§

public function __construct(
    public Name|null $existing = null,
    list<Scalar> $partition = [],
    list<SortItem> $order = [],
    public WindowFrame|null $frame = null,
)

Parameters

$existingName|nullThe window of the WINDOW clause this specification refines
$partitionlist<Scalar>The partitioning expressions
$orderlist<SortItem>The ordering within a partition
$frameWindowFrame|nullThe frame
Calls 3
public function render(Output $out): void

Test cases 12§

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 8

Relations§

Instantiated in 1
Method calls 1
Type checks 3
Type declarations 10