db icon indicating copy to clipboard operation
db copied to clipboard

Support FETCH n FIRST/NEXT ROWS expression for limit

Open Insolita opened this issue 3 years ago • 1 comments

Postgres since 13, and oracle since 12 ver support expression

OFFSET start { ROW | ROWS } FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } { ONLY | WITH TIES }

MariaDb also supports since 10.6 https://mariadb.com/kb/en/select-offset-fetch/

Right now there is no way to use it with QueryBuilder.

Propose for add ability to add fetch() construction or allow custom Expression for limit() without "LIMIT" prefix if it starts with "FETCH" at this place https://github.com/yiisoft/db/blob/48e2a815263f7da5b02fa4f88f1bc1bb106c8e27/src/Query/QueryBuilder.php#L1724

same for yii2 https://github.com/yiisoft/yii2/issues/18639

Insolita avatar May 08 '21 10:05 Insolita

@samdark , see yii3 chat, there are many ideas, limit('FETCH x ...') , separate fetch(), common appendClause() method

Insolita avatar May 08 '21 22:05 Insolita