5.14.0 — 2026-10-14¶
← 5.15.0 | 5.13.0 → | ↑ 5.x series
Added¶
Models - DTOs¶
- Search output DTOs -
SearchOutputDTOcarriestotal_countand a computedtotal_count_estimated. With a count threshold the total is exact up to the threshold and a PostgreSQL estimate above it, and the estimate is always above the threshold, sototal_count_estimatedistruewhentotal_countis above theCOUNT_THRESHOLDof the SQLAlchemy config. An API can show "10000+" instead of an invented number.- It reads
POSTGRES_SQLALCHEMYby default. A subclass setscount_threshold_configfor another config. Without a global config or a threshold the flag isfalse. ExactSearchOutputDTOhas the same fields withtotal_count_estimatedalwaysfalse, for searches that count on their own.
- It reads
Configs - Pagination¶
PaginationConfig- NewPAGINATIONconfig onBaseConfigwithMAX_ITEMS(default10000), set withPAGINATION__MAX_ITEMS. It is the deepestpage * page_sizeaPaginationDTOaccepts.
Changed¶
Models - DTOs¶
PaginationDTOlimit from config -PaginationDTO.MAX_ITEMSisNoneby default and the limit comes fromPAGINATION.MAX_ITEMSof the global config, or from thePaginationConfigdefault when no global config is set. A subclass that sets its ownMAX_ITEMSkeeps it.
Configs - SQLAlchemy¶
- Default
COUNT_THRESHOLD-BaseConfig.set_global()fills an unsetCOUNT_THRESHOLDof the SQLAlchemy, PostgreSQL, MySQL, SQLite and StarRocks configs withPAGINATION.MAX_ITEMS. A search on PostgreSQL now returns an estimated total above 10000 rows instead of counting them, where it used to count exactly. SetCOUNT_THRESHOLDto a larger number to count exactly for longer.
Tests¶
- Search output DTO and pagination config - New scenarios in
atomic_transactions.featurecover the estimated and exact flags around the threshold on PostgreSQL. New scenarios inbase_config.featurecover the default threshold fromPAGINATION.MAX_ITEMS, an explicit threshold winning over it and the pagination limit following it.
Chore¶
- Docs - The search totals tutorial explains the default threshold and the search output DTOs, and the API
reference lists
search_output_dtoandPaginationConfig.