Skip to content

5.14.0 — 2026-10-14

← 5.15.0 | 5.13.0 → | ↑ 5.x series

Added

Models - DTOs

  • Search output DTOs - SearchOutputDTO carries total_count and a computed total_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, so total_count_estimated is true when total_count is above the COUNT_THRESHOLD of the SQLAlchemy config. An API can show "10000+" instead of an invented number.
    • It reads POSTGRES_SQLALCHEMY by default. A subclass sets count_threshold_config for another config. Without a global config or a threshold the flag is false.
    • ExactSearchOutputDTO has the same fields with total_count_estimated always false, for searches that count on their own.

Configs - Pagination

  • PaginationConfig - New PAGINATION config on BaseConfig with MAX_ITEMS (default 10000), set with PAGINATION__MAX_ITEMS. It is the deepest page * page_size a PaginationDTO accepts.

Changed

Models - DTOs

  • PaginationDTO limit from config - PaginationDTO.MAX_ITEMS is None by default and the limit comes from PAGINATION.MAX_ITEMS of the global config, or from the PaginationConfig default when no global config is set. A subclass that sets its own MAX_ITEMS keeps it.

Configs - SQLAlchemy

  • Default COUNT_THRESHOLD - BaseConfig.set_global() fills an unset COUNT_THRESHOLD of the SQLAlchemy, PostgreSQL, MySQL, SQLite and StarRocks configs with PAGINATION.MAX_ITEMS. A search on PostgreSQL now returns an estimated total above 10000 rows instead of counting them, where it used to count exactly. Set COUNT_THRESHOLD to a larger number to count exactly for longer.

Tests

  • Search output DTO and pagination config - New scenarios in atomic_transactions.feature cover the estimated and exact flags around the threshold on PostgreSQL. New scenarios in base_config.feature cover the default threshold from PAGINATION.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_dto and PaginationConfig.