We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ad9af70 + 95fbd72 commit a11017cCopy full SHA for a11017c
fastapi_pagination/ext/async_sqlalchemy.py
@@ -20,7 +20,7 @@ async def paginate(
20
) -> AbstractPage: # pragma: no cover # FIXME: fix coverage report generation
21
params = resolve_params(params)
22
23
- total = await session.scalar(select([func.count()]).select_from(query))
+ total = await session.scalar(select(func.count()).select_from(query.subquery())) # type: ignore
24
items = await session.execute(paginate_query(query, params))
25
26
return create_page([*items.scalars()], total, params)
0 commit comments