-
This FastAPI project generator generates a DAO for a dummy model with a useful FastAPI dependency of a DB session as an instance variable. def __init__(self, session: AsyncSession = Depends(get_db_session)):
self.session = session I am struggling to understand how to pass this over to a taskiq task so the task can write stuff to my app's database, as it (of course) is not serializable. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Just pass it as a dependency. Take a look at this docs page. If you used fastapi-template, then integration should be enabled, you just have to use |
Beta Was this translation helpful? Give feedback.
Anyway. Try updating to https://github.com/taskiq-python/taskiq/releases/tag/0.9.2. This PR should fix these issues.