classCommaLimit
final class CommaLimit
implements Node
uses Snapshot
Public API: explicitly declared with
@visibility public.LIMIT count, offset: a spelling the grammar accepts and PostgreSQL rejects.
The server asks for separate LIMIT and OFFSET clauses instead; the structure keeps both operands and the query reports the problem. Source: https://www.postgresql.org/docs/17/sql-select.html#SQL-LIMIT.
(new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('SELECT 1 LIMIT 1, 2') // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\SemanticException: LIMIT #,# syntax is not supportedProperties§
public Scalar|null $countpublic Scalar $offsetMethods§
public function __construct(public Scalar|null $count, public Scalar $offset)Parameters
$count | Scalar|null | The row count; null for ALL |
$offset | Scalar | The number of rows to skip |
public function render(Output $out): voidWrites LIMIT, the count or ALL, a comma and the offset.
Parameters
$out | Output |
Calls 3
- method-call Output::keyword() line 40
- method-call Output::node() line 44
- method-call Output::symbol() line 46
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
CommaLimitTestcalls
Relations§
Instantiated in 1
Type checks 3
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Query\Limits::derive() packages/sql-semantics-postgres/src/Rules/Query/Limits.php:48
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Query\Limits::derive() packages/sql-semantics-postgres/src/Rules/Query/Limits.php:54
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Query\Trailing::limit() packages/sql-semantics-postgres/src/Rules/Query/Trailing.php:120