Releases: uriyyo/fastapi-pagination
Releases Β· uriyyo/fastapi-pagination
0.12.34
0.12.33
0.12.32
0.12.31
0.12.30
0.12.29
New Feature
sqlalchemy
unwrap_mode
allows you to control how to unwrap result rows before passing them to items transformer
and page creation.
unwrap_mode
can be set to one of the following values:
None
- will useauto
mode for default queries, andlegacy
fortext
andfrom_statement
queries."auto"
- will unwrap only in case if you are selecting single model."legacy"
- will use old behavior, where row will be unwrapped if it contains only one element."unwrap"
- will always unwrap row, even if it contains multiple elements."no-unwrap"
- will never unwrap row, even if it contains only one element.
0.12.28
- Add better logic for
sqlalchemy
scalars unwrapping. #1281 - Fix issue with
sqlalchemy
imports forgino
ext. #1282 - Fix issue with incorrect body schema. #1299
Breaking changes
sqlachemy
extension no longer requires to use items_transformer
when selecting scalar field:
This code is no longer valid:
paginate(session, select(User.name), transformer=lambda items: [{'name': item} for item in items])
The correct version now is:
paginate(session, select(User.name))
0.12.27
0.12.26
- Fix issue with passing
count_query
intosqlalchemy
/sqlmodel
. #1194 - Add ability to use async
length_function
withasync_paginator
. #1204 - Fix incorrect total number in page when paginating
beanie
query withfetch_links=True
. #1199
Thanks to @moumoutte and @IterableTrucks!