Skip to content

Releases: uriyyo/fastapi-pagination

0.12.32

16 Nov 10:40
Compare
Choose a tag to compare
  • Add support for sqlalchemy CompoundSelect. #1361

0.12.31

08 Oct 17:02
a602457
Compare
Choose a tag to compare
  • Add NotImplementedError to ignored exc when resolving unwrap-mode. #1324

0.12.30

07 Oct 20:53
92bd0b7
Compare
Choose a tag to compare
  • Fix issue when select model with single field. #1317

NOTE! This is last release before 0.13.0 version.

0.12.29

01 Oct 12:36
894b38c
Compare
Choose a tag to compare
  • Fix issue with sqlalchemy scalar select detection. #1313
  • Add unwrap mode for sqlalchemy ext. #1316

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 use auto mode for default queries, and legacy for text and from_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

29 Sep 08:56
62600b1
Compare
Choose a tag to compare
  • Add better logic for sqlalchemy scalars unwrapping. #1281
  • Fix issue with sqlalchemy imports for gino 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

10 Sep 15:38
Compare
Choose a tag to compare
  • Bump to next pytest-asyncio version. #1118
  • Bump to next fastapi version. #1275
  • Support total parameter for tortoise ext. #1269
  • Add support for sqlalchemy from statement. #1277

0.12.26

02 Jul 15:00
5666634
Compare
Choose a tag to compare
  • Fix issue with passing count_query into sqlalchemy/sqlmodel. #1194
  • Add ability to use async length_function with async_paginator. #1204
  • Fix incorrect total number in page when paginating beanie query with fetch_links=True. #1199

Thanks to @moumoutte and @IterableTrucks!

0.12.25

08 Jun 08:16
48c0853
Compare
Choose a tag to compare
  • Fix issue with databases + sqlalchemy 2.0. #1160
  • Move FastAPI to dev dependencies. #1175
  • Add UseAdditionalFields customization. #1180

0.12.24

26 Apr 18:21
b865ce3
Compare
Choose a tag to compare
  • Improve resolve_params exc message. #1129
  • Add odmantic integration. #1130

0.12.23

17 Apr 15:55
16969d0
Compare
Choose a tag to compare
  • Add limit to CursorParams.size field. #1119
  • Strip extra lines before and after the _WARNING_MSG. #1117

Thanks to @barsikus007 and @frost-nzcr4!

Breaking changes:

CursorPage now has default upper limit for size query param (size should be <= 100).

If you want to remove this restriction and use old behavior, you can customize CursorPage:

from fastapi_pagination.cursor import CursorPage as BaseCursorPage
from fastapi_pagination.customization import UseParamsFields, CustomizedPage


CursorPage = CustomizedPage[
    BaseCursorPage,
    UseParamsFields(
        size=Query(50, ge=0),
    ),
]