This repository was archived by the owner on Aug 19, 2025. It is now read-only.

Description
If I want to run a long operation, I would want to do it in a thread to not block the async event-loop. asyncio provides run_in_executor() for exactly this. However, it is not clear whether my databases.Database object is safe to use in the thread, and whether there is something I can do to make it work (short of creating a brand new sa.Engine and sa.Connection with SQLAlchemy from the original URL. Or maybe one sa.Engine for the whole thread pool?)