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

Lowers the LIMIT, OFFSET, FETCH and locking clauses.

Rule: PG-LIMIT-LOWER-001. Scope: opt_select_limit, select_limit, limit_clause, offset_clause, select_limit_value, select_offset_value, select_fetch_first_value, first_or_next, row_or_rows, opt_for_locking_clause, for_locking_clause, for_locking_items, for_locking_item, for_locking_strength, locked_rels_list, opt_nowait_or_skip. Constructors: RowLimit, LimitCount, CommaLimit, FetchFirst, Offset, LockingClause. FIRST and NEXT, ROW and ROWS are noise words; a plus sign before a numeric constant in FETCH and OFFSET … ROWS is dropped by the server, a minus sign negates it as it does in an expression. Termination: lists are flattened iteratively. Source: https://www.postgresql.org/docs/17/sql-select.html#SQL-LIMIT, https://www.postgresql.org/docs/17/sql-select.html#SQL-FOR-UPDATE-SHARE. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe hub
public function rowsOffset(Form $form): Offset
public function noise(Node $node, string ...$signatures): void
public function locking(Node $clause): array{list<LockingClause>, bool}

Lowers opt_for_locking_clause or for_locking_clause: the locking clauses and whether FOR READ ONLY is written.

Parameters

$clauseNode

Returns

array{list<LockingClause>, bool}

Throws

ImplementationGap When the production has no rule
Test cases 1
Called from 2
Calls 3
public function wait(Node $wait): ?LockWait

Lowers opt_nowait_or_skip; waiting is null.

Parameters

$waitNode

Returns

Throws

ImplementationGap When the production has no rule
Test cases 1
Called from 1
Calls 3

Private surface 2§

Implementation details, listed for orientation only.

private const STRENGTHS = ['for_locking_strength: FOR UPDATE' => \SqlSemantics\Platform\PostgreSql\Statem…
private Lowering $lowering

Test cases 13§

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

Dedicated tests 13

Relations§

Instantiated in 2
Method calls 2