Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Add equivalent to psycopg2 `register_adapter`

Open
#1,186 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
postgresql, python
Domain
databases

Research direction

Start by reviewing asyncpg's existing set_type_codec support and psycopg2's register_adapter behavior. Determine how custom Python classes should be represented for query parameters without requiring PostgreSQL types, and define completion around equivalent add and select behavior without manual str() casts.

Written by the indexing model from the issue text.

Description

In psycopg2, register_adapter along with utility functions provides a useful way to map custom Python classes into valid representations, often by relatively simple behaviors such as casting to str. There is no equivalent in asyncpg meaning moving from psycopg2 to asyncpg requires adding lots of str() casts to add and select queries.

The closest equivalent is set_type_codec but this only works for types that are registered with Postgres, not custom Python classes.

Dominant language
Python
Stars
8.1k
Forks
469
Avg merge
2d 20h
Merged PRs (30d)
9

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MagicStack/asyncpg

All issues in MagicStack/asyncpg

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.