Skip to content

Add Pool class to the public API #643

New issue

Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “No Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? No Sign in to your account

Closed
rugleb opened this issue Oct 25, 2020 · 1 comment
Closed

Add Pool class to the public API #643

rugleb opened this issue Oct 25, 2020 · 1 comment

Comments

@rugleb
Copy link
Contributor

rugleb commented Oct 25, 2020

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
@elprans
Copy link
Member

elprans commented Nov 26, 2020

Seems reasonable. Please send a pull request.

No Sign up for free to join this conversation on GitHub. Already have an account? No Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants