databases icon indicating copy to clipboard operation
databases copied to clipboard

Allow passing kwargs to high-level api

Open juntatalor opened this issue 5 years ago • 2 comments

Hello! My case is about passing timeout argument to asyncpg backend (methods acquire, execute, fetch, etc), because it is important in async python applications.

For now it absolutely impossible. I tried to subclass Database, Connnection, PostgresBackend, PostgresConnection classes to allow passing the timeout argument, but it is a lot of copypaste code, that is hard to support.

Moving further, i thing it is cool to extend base api methods (Database, Connection and backend classes) with ability to accept **kwargs.

juntatalor avatar Aug 17 '20 06:08 juntatalor

I too just noticed that it's not possible to pass a timeout to databases. This is normally a kwarg that can be sent to asyncpg methods 😢

fgimian avatar Sep 26 '20 14:09 fgimian

I had hoped I could workaround this by wrapping database.connect in asyncio.wait_for to get a timeout, but for some reason, it's not cancelling.

dusty-phillips avatar Jul 07 '21 13:07 dusty-phillips