Skip to content

Custom Codec across connection pool #221

Closed
@egalpin

Description

@egalpin
  • asyncpg version: 0.13.0
  • PostgreSQL version: 9.6.5 (Docker)
  • Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
    the issue with a local PostgreSQL install?
    :
  • Python version: 3.6.0
  • Platform: Mac OS X
  • Do you use pgbouncer?: No
  • Did you install asyncpg with pip?: Yes
  • If you built asyncpg locally, which version of Cython did you use?:
  • Can the issue be reproduced under both asyncio and
    uvloop?
    : yes

Related to #140, I originally set out to set a custom codec for JSONB (which the thread of issue 140 solved for me).

The current solution for overriding builtin codecs for various types is great on a per connection basis. This works great if you're using a single connection object everywhere, but becomes troublesome when working with a connection pool.

Is there an abstraction layer that I'm misunderstanding (i.e. just use connection and a pool is managed), or is there a pleasant way to go about adding a custom codec to all the connections in my app's pool on start up?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions