You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's been a long time since I've used SQL and my own project is very old, so I'm asking out of curiosity and not trying to learn with the latest version.
I think if I implement the latest version, I should be able to solve the problem.
Hello! I have been developing from this template since 2022.
At that time I saw that the model was using
{"lazy": "selectin"}
and I used it myself without any problems.However, there are times when I need to use joined to improve performance, but when I use joined I have a problem with
unique()
.I came across #20 and changed selectin to use joined.
I found from https://github.com/jonra1993/fastapi-alembic-sqlmodel-async/blob/main/backend/app/app/crud/base_crud.py#L35 that unique() is not used.
I ran docker-compose-dev.yml and the API works fine.
My model uses
sa_relationship_kwargs={"lazy": "joined"}
.But in my context must use
response.unique().scalar_one_or_none()
!I would like to know why there is no problem with this project, but I am having problems.
Could it be a version issue? After all, I developed this project with reference to 2022 and the kit is a bit old.
Thanks for any feedback.
The text was updated successfully, but these errors were encountered: