final class Trailing
Restricted visibility: declared "@visibility SqlSemantics". Code outside that scope must not name this declaration.

Finds the expression a query is written to end with, so that a statement can tell whether a token it writes after the query would continue that expression.

Rule: PG-QUERY-TRAILING-001. A query ends with an expression when its last written clause does: the last unaliased select-list item, a FROM item that ends with a JOIN ... ON condition, WHERE, the last GROUP BY expression, HAVING, the last ORDER BY expression without a direction, NULLS or USING, or a LIMIT or OFFSET count. A set operation ends where its right operand does, a query with a WITH clause or trailing clauses where its body or those clauses do. VALUES, TABLE, a parenthesized query, a WINDOW clause, a locking clause, FETCH, an alias and INTO end with a closing token or a name. CREATE VIEW ... WITH CHECK OPTION and CREATE TABLE AS / CREATE MATERIALIZED VIEW ... WITH [NO] DATA write WITH after the query, which an IS JSON test at the end would take (Precedence::takesUniqueness). Terminates: each step descends into a part of a finite tree. Source: https://github.com/postgres/postgres/blob/REL_17_2/src/backend/parser/gram.y (simple_select, select_limit, json_key_uniqueness_constraint_opt). Status: Implemented.

Methods§

public function limit(RowLimit $limit): ?Scalar

Answers the count a limit ends with, or null for LIMIT ALL and FETCH.

Parameters

$limitRowLimit

Returns

Test cases 1
Called from 1

Test cases 12§

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

Dedicated tests 12

Relations§

Instantiated in 3
Method calls 3