final class SelectFacts
Restricted visibility: declared "@visibility SqlSemantics\Platform\PostgreSql". Code outside that scope must not name this declaration.

Derives the facts of a selection and of a TABLE query.

Rule: PG-SELECT-SCOPE-001. The FROM items are derived in the environment of the enclosing query (PG-FROM-SCOPE-001). WHERE, the select list, GROUP BY, HAVING, the named windows, DISTINCT ON and ORDER BY see the relations of the FROM items and, beyond them, the enclosing queries; the select list does not see its own output names, and GROUP BY, DISTINCT ON and ORDER BY follow PG-ORDERING-001. LIMIT and OFFSET see only the enclosing queries (PG-LIMIT-001). The ORDER BY and locking clauses written after parentheses around the selection are its own (PG-QUERY-OPTIONS-001). With grouping sets a grouped column is NULL in the rows of the sets that do not group it, so every output field can be NULL. Locking is reported with DISTINCT, GROUP BY and HAVING. The output fields follow PG-TARGET-001 and PG-STAR-001. Terminates: every clause is a strict part of the selection. Source: https://www.postgresql.org/docs/17/sql-select.html, https://www.postgresql.org/docs/17/queries-table-expressions.html#QUERIES-GROUPING-SETS. Status: Implemented.

Methods§

public function options(
    list<SelectOptions> $layers,
    list<Field|OpenStar> $items,
    list<VisibleRelation> $visible,
    Derivation $derivation,
    Environment $rows,
    Environment $base,
    ?SelectOptions $own,
    ?Relation $from = null,
): void
public function locks(list<SelectOptions> $layers): bool
public function grouped(Select $select, list<Field|OpenStar> $items): list<Field|OpenStar>

Answers the output with every field able to be NULL when GROUP BY has grouping sets.

Parameters

$selectSelect
$itemslist<Field|OpenStar>

Returns

Called from 1
Calls 4

Test cases 2§

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

Dedicated tests 2

Relations§

Instantiated in 2
Method calls 2