91373[FEATURE] Provide pagination for QueryBuilder
Commit message
Review
-
Code review CR +2 Done
- Georg Ringer +2
- Garvin Hicking +1
-
Verified V +2 Done
- Georg Ringer +2
- Garvin Hicking +1
- core-ci +1 CI
Issues 1
Files 5
- typo3/sysext/core/Classes/Pagination/QueryBuilderPaginator.php10new+103 −0
- typo3/sysext/core/Documentation/Changelog/14.2/Feature-102194-QueryBuilderPaginator.rstnew+68 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_tca/Configuration/TCA/tx_pagination_item.phpnew+20 −0
- typo3/sysext/core/Tests/Functional/Pagination/Fixtures/DataSet/pagination.csvnew+16 −0
- typo3/sysext/core/Tests/Functional/Pagination/QueryBuilderPaginatorTest.phpnew+192 −0
Review log 1626
Show 1 earlier messages
-
Georg Ringer uploaded patch set 1 10/30/25, 18:34
-
core-ci voted on patch set 1 V -1 10/30/25, 18:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88175
-
Georg Ringer uploaded patch set 2
V -110/30/25, 18:54 -
core-ci voted on patch set 2 V +1 10/30/25, 19:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88178
-
Stefan Froemken uploaded patch set 3
V +102/24/26, 21:55 -
core-ci voted on patch set 3 V +1 02/24/26, 22:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96779
-
Stefan Froemken updated the commit message in patch set 4
V +102/24/26, 22:11 -
core-ci voted on patch set 4 V +1 02/24/26, 22:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96783
-
Stefan Bürk commented on patch set 4 03/05/26, 15:37
QueryBuilderPaginator.php:85The whole solution introduces quite a lot of code and using "internal" api droped by upstream doctrine/dbal querybuilder already and only kept internal for some places in TYPO3 (TypoScript Database Query thing) to get the parts. We should abstain from increasing the usage of them as this implementation may act as example for some developers and we should not emphasize internal api. Technically I would replace all this handling and use a simple non-recursive CTE query for it: ```sql WITH -- cte parts cte_base AS ( /* SQL from cloned $queryBuilder and removed parts */ ) -- main part SELECT COUNT(*) from cte_base ``` over the classic "subquery select" done here conditionally. Using a CTE is better supported by dbms engines and allows for better optimization in the background and compared to a direct table count in the false condition part there is no real impact as the full result set needs to be generated anyway to create a count on it. The CTE api is php code wise a little bit cleaner and smaler than handing over a querybuilder instance as select part through the decorated concrete QueryBuilder instance. The current implementation does not support having a `UNION` query and would possible breaks the intended query. Or even worser, if a CTE query may be handed over. A complete CTE as cte part (nested) is allowed and taken all the points into account I'd would prefere using a CTE here. Despite mentioning `@internal` API above, we need to use the internal prefixed CTE variant `$queryBuilder->typo3_with()` here for now. doctrine/dbal has already rudimentary CTE `$queryBuilder->with()` but that is not adopted yet into our decorator construct. As I plan to raise doctrine/dbal after adding some additional CTE stuff upstream (recursive support and similar) I would take care of replacing the internal usage anyway and this place would be the second place it is used despite functional tests and RootlineUtility). I'm going to push a new change set with the CTE construct.QueryBuilderPaginator.php:92QueryBuilder has an API for such things and we should use that and abstain from composing plain sql queries.. -
Stefan Bürk uploaded patch set 5
V +103/05/26, 16:55 -
Stefan Bürk uploaded patch set 6 03/05/26, 17:04
-
core-ci voted on patch set 5 V -1 03/05/26, 17:06 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97422
-
core-ci voted on patch set 6 V +1 03/05/26, 17:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97425
-
core-ci commented on patch set 6 03/05/26, 17:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97426
-
Georg Ringer uploaded patch set 7
V +103/06/26, 06:46 -
Georg Ringer commented on patch set 7 03/06/26, 06:46
This change is ready for review. -
core-ci voted on patch set 7 V +1 03/06/26, 06:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97467
-
Simon Schaufelberger commented on patch set 7 03/06/26, 08:41
Use markdown syntaxQueryBuilderPaginator.php:39PrivateQueryBuilderPaginator.php:43Can be private because of final -
Georg Ringer uploaded patch set 8
V +103/06/26, 09:31 -
core-ci voted on patch set 8 V +1 03/06/26, 09:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97475
-
Simon Schaufelberger uploaded patch set 9
V +103/06/26, 09:57 -
Simon Schaufelberger commented on patch set 9 03/06/26, 10:00
Reply
Done -
core-ci voted on patch set 9 V +1 03/06/26, 10:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97480
-
Garvin Hicking commented on patch set 9 CR +1 V +1 03/06/26, 11:30
QueryBuilderPaginator.php:39ReplyDoneQueryBuilderPaginator.php:43ReplyDoneQueryBuilderPaginator.php:78ReplyDoneQueryBuilderPaginator.php:85ReplyDoneQueryBuilderPaginator.php:92ReplyDone -
Georg Ringer voted on patch set 9 CR +2 V +2 03/06/26, 12:36
-
Georg Ringer merged patch set 10 03/06/26, 12:36
QueryBuilderPaginator.php:78