Hi,
I have the tables Author and Books.
| Author |
Book |
| Alice |
A |
| Alice |
B |
| Bob |
C |
In my FastAPI endpoint, when paginating the select(Author).join(Books) I want to respond with a list that has 2 dicts:
- Alice (with her two books)
- Bob (with his one book)
It works great but the total is off. Instead of counting the unique Authors, it counts the total rows of the query.
Is there an option to fix that?
Perhaps relevant:
- using FastAPI (+pydantic)
- async PostgreSQL