classRowLimit
final class RowLimit
implements Node
uses Snapshot
Public API: explicitly declared with
@visibility public.The LIMIT, FETCH FIRST and OFFSET clauses of a query, in the order written.
Mirrors limitCount, limitOffset and limitOption of PostgreSQL's SelectStmt. The count and the offset may be written in either order; the order is kept. Source: https://www.postgresql.org/docs/17/sql-select.html#SQL-LIMIT.
$query = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('SELECT 1 OFFSET 1 LIMIT 2');
[$query->statement->options->limit->offsetFirst, $query->toString()] // => [true, 'SELECT 1 OFFSET 1 LIMIT 2']new \SqlSemantics\Platform\PostgreSql\Statement\Query\Limit\RowLimit() // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\InvalidConstructionProperties§
public LimitCount|CommaLimit|FetchFirst|null $count = nullpublic Offset|null $offset = nullpublic bool $offsetFirst = falseMethods§
public function __construct(
public LimitCount|CommaLimit|FetchFirst|null $count = null,
public Offset|null $offset = null,
public bool $offsetFirst = false,
)Parameters
$count | LimitCount|CommaLimit|FetchFirst|null | The row count clause |
$offset | Offset|null | The offset clause |
$offsetFirst | bool | Whether the offset is written before the count |
Calls 1
- static-call Check::input() line 41
public function render(Output $out): voidWrites the count and the offset in the order written.
Parameters
$out | Output |
Calls 1
- method-call Output::node() line 51
Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
RowLimitTestcalls
Other tests reaching this symbol 2
Relations§
Instantiated in 4
- new SqlSemantics\Platform\PostgreSql\Lowering\Query\LimitRule::limit() packages/sql-semantics-postgres/src/Lowering/Query/LimitRule.php:71
- new SqlSemantics\Platform\PostgreSql\Lowering\Query\LimitRule::limit() packages/sql-semantics-postgres/src/Lowering/Query/LimitRule.php:72
- new SqlSemantics\Platform\PostgreSql\Lowering\Query\LimitRule::limit() packages/sql-semantics-postgres/src/Lowering/Query/LimitRule.php:73
- new SqlSemantics\Platform\PostgreSql\Lowering\Query\LimitRule::limit() packages/sql-semantics-postgres/src/Lowering/Query/LimitRule.php:74
Type declarations 3
- type SqlSemantics\Platform\PostgreSql\Lowering\Query\LimitRule packages/sql-semantics-postgres/src/Lowering/Query/LimitRule.php:64
- type SqlSemantics\Platform\PostgreSql\Rules\Query\Trailing packages/sql-semantics-postgres/src/Rules/Query/Trailing.php:114
- type SqlSemantics\Platform\PostgreSql\Statement\Query\Clause\SelectOptions packages/sql-semantics-postgres/src/Statement/Query/Clause/SelectOptions.php:53