From the release notes, it looks like this was mostly cleanup.
The one interesting thing I see is the @asynccontextmanager decorator.
from contextlib import asynccontextmanager
@asynccontextmanager
async def get_connection():
conn = await acquire_db_connection()
try:
yield
finally:
await release_db_connection(conn)
async def get_all_users():
async with get_connection() as conn:
return conn.query('SELECT ...')
Like the demo, the biggest thing I'd use for this is database connections and requests. But as far as I know, support in SQLAlchemy for async connections is weak. Does anybody know more about that? I know of aiopg for Postgres.
2 comments
[ 5.8 ms ] story [ 23.5 ms ] threadThe one interesting thing I see is the @asynccontextmanager decorator.
Like the demo, the biggest thing I'd use for this is database connections and requests. But as far as I know, support in SQLAlchemy for async connections is weak. Does anybody know more about that? I know of aiopg for Postgres.