Closed savvan0h closed 1 month ago
Hi @savvan0h,
Thanks for the issue, I will think about how we can fix it.
Hi @savvan0h,
New version 0.12.28
has been released, and now your code should work as expected without any changes from your side.
Thanks for the quick fix! The issue is resolved now.
I encountered a validation error when querying only a single field from a model using SQLModel. The error occurs when using the following code:
The issue seems to stem from the
unwrap_scalars()
function inext/sqlalchemy.py
, which converts the result items to strings when a single field is selected.https://github.com/uriyyo/fastapi-pagination/blob/139f4eea477d7d86879452e939023b77df21c7c9/fastapi_pagination/ext/sqlalchemy.py#L183
To work around this issue, I had to manually transform the items into dictionaries like below:
Given that both SQLAlchemy and SQLModel share the same code, it is likely that this issue affects SQLAlchemy as well.