feat: add include_total flag to offset pagination to skip COUNT query (#158)

This commit is contained in:
d3vyce
2026-03-21 15:16:22 +01:00
committed by GitHub
parent 6d6fae5538
commit f8c9bf69fe
6 changed files with 146 additions and 23 deletions

View File

@@ -85,6 +85,8 @@ GET /articles/offset?page=2&items_per_page=10&search=fastapi&status=published&or
`filter_attributes` always reflects the values visible **after** applying the active filters. Use it to populate filter dropdowns on the client.
To skip the `COUNT(*)` query for better performance on large tables, pass `include_total=False`. `pagination.total_count` will be `null` in the response, while `has_more` remains accurate.
### Cursor pagination
Best for feeds, infinite scroll, or any high-throughput API where offset performance degrades.