asyncpg
asyncpg copied to clipboard
Implement AsyncContextManager for connection
Ideally, the following code would work:
import asyncpg
async def main():
async with asyncpg.connect() as conn: #
await conn.execute("SELECT")
Instead, the connection must be managed manually.
Looks like a good improvement to me. Feel free to send a PR!