// the find
encode/databases
Async database support for Python. 🗄
Databases is a thin async wrapper over SQLAlchemy Core expressions, letting you run parameterized queries against Postgres, MySQL, and SQLite without blocking the event loop. It's the library FastAPI tutorials pointed people toward circa 2020–2022. The target is async web frameworks that need raw SQL or SQLAlchemy Core without the full ORM.
Supports multiple backends with a consistent API — asyncpg, aiopg, aiomysql, asyncmy, aiosqlite all behind the same Database class. Transaction context manager is clean and composable. Parameterized query handling via SQLAlchemy Core means you get dialect-aware query building without the ORM overhead. Connection pool management is handled for you with connect/disconnect lifecycle hooks that integrate naturally with ASGI lifespan.
Last meaningful push was May 2024 and the repo has the feel of soft-abandoned — open issues pile up, SQLAlchemy 2.0's own async support (asyncio extension) has largely made this library redundant. No support for SQLAlchemy ORM, only Core, so you're writing raw SQL or expression objects with no model layer. The multi-backend abstraction leaks: some backends support features others don't and the docs don't surface the gaps well. If you're starting a new project today, SQLAlchemy's native async support is the better bet — it's actively maintained by the same people who maintain the query engine.