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

A parenthesized list of grouping terms in GROUP BY, ROLLUP, CUBE or GROUPING SETS: (a, 1).

A row written without ROW in a grouping position is not a row value: PostgreSQL's flatten_grouping_sets replaces such a row by the list of its fields, so GROUP BY (a, b) groups by a and b, and ROLLUP ((a, b), c) rolls a and b up together. Each field is a grouping term of its own: an integer constant is an output position, and an unqualified name may denote an output column. Nested rows are flattened the same way; a row with one member is a further pair of parentheses around a row. Source: https://www.postgresql.org/docs/17/queries-table-expressions.html#QUERIES-GROUPING-SETS.

Reading the terms of a row in GROUP BYdoctest
$query = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('SELECT 1 AS a GROUP BY (a, 1)');
    [count($query->statement->groupBy[0]->members), $query->statement->groupBy[0]->members[1]::class] // => [2, \SqlSemantics\Platform\PostgreSql\Statement\Query\Clause\OutputPosition::class]
Refusing an integer constant that is not an output positiondoctest
new \SqlSemantics\Platform\PostgreSql\Statement\Query\Grouping\GroupingRow([new \SqlSemantics\Platform\PostgreSql\Statement\Literal\Constant(new \SqlSemantics\Platform\PostgreSql\Statement\Literal\IntegerConstant('1')), new \SqlSemantics\Platform\PostgreSql\Statement\Literal\Constant(new \SqlSemantics\Platform\PostgreSql\Statement\Literal\IntegerConstant('2'))]) // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\InvalidConstruction

Properties§

public non-empty-list<Scalar|GroupingRow> $members

Methods§

public function __construct(list<Scalar|GroupingRow> $members)

Parameters

$memberslist<Scalar|GroupingRow>The members in written order: at least two, or one row in further parentheses
Calls 8
public function render(Output $out): void

Writes the row.

Parameters

$outOutput
Calls 1

Test cases 3§

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 2

Relations§

Instantiated in 2
Constant reads 2
Type checks 1