Skip to content

Add Pool class to the public API #643

Closed
@rugleb

Description

@rugleb

I want to add the Pool class to the public API. This can be useful and convenient for type annotations.

Now it is done like this:

import attr
from asyncpg.pool import Pool

@attr.s(slots=True, frozen=True, auto_attribs=True)
class CompanyRepository:
    pool: Pool

    async def find(self, company_id: UUID) -> Optional[Company]:
        pass

I suggest adding this feature:

import attr
import asyncpg

@attr.s(slots=True, frozen=True, auto_attribs=True)
class CompanyRepository:
    pool: asyncpg.Pool

    async def find(self, company_id: UUID) -> Optional[Company]:
        pass

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