jonra1993 / fastapi-alembic-sqlmodel-async

This is a project template which uses FastAPI, Pydantic 2.0, Alembic and async SQLModel as ORM. It shows a complete async CRUD using authentication and role base access control.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Calling postgres from celery

bazylhorsey opened this issue · comments

Right now we can use syncify with the CRUD functions inside celery, but aysncpg is still in charge of the session. This seems suboptimal but switching into psychopg seems like a lot of duplicated work? Is using asyncpg fine for this use-case?

Hello @bazylhorsey thanks for your questions I also agree such operation is not the best for now and the cause is celery-sqlalchemy-scheduler which is online has sync support and it uses an old sqlalchemy implementation. I was thinking that in the future it could be a good idea to improve the implementation so it can support async. For now, using async is the best because the lib requires it.