Skip to content

Implement AsyncContextManager for connection #760

Open
@pauldraper

Description

@pauldraper

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions