Skip to content

fix: translate multi-host URLs via SQLAlchemy dialect for LISTEN#12

Merged
lesnik512 merged 1 commit into
mainfrom
fix/listen-multihost-dsn
May 21, 2026
Merged

fix: translate multi-host URLs via SQLAlchemy dialect for LISTEN#12
lesnik512 merged 1 commit into
mainfrom
fix/listen-multihost-dsn

Conversation

@lesnik512
Copy link
Copy Markdown
Member

asyncpg.connect(dsn) failed with TargetServerAttributeNotMatched on URLs of the form ?host=h1:5432&host=h2:5432 because render_as_string URL-encodes the host:port pair into a single token asyncpg can't parse. Delegate URL → kwargs translation to engine.dialect.create_connect_args so multi-host URLs reach asyncpg as host=[...], port=[...] (same approach as the org's db-retry).

asyncpg.connect(dsn) failed with TargetServerAttributeNotMatched on URLs of
the form ?host=h1:5432&host=h2:5432 because render_as_string URL-encodes the
host:port pair into a single token asyncpg can't parse. Delegate URL → kwargs
translation to engine.dialect.create_connect_args so multi-host URLs reach
asyncpg as host=[...], port=[...] (same approach as the org's db-retry).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@lesnik512 lesnik512 self-assigned this May 21, 2026
@lesnik512 lesnik512 merged commit f6671dd into main May 21, 2026
3 checks passed
@lesnik512 lesnik512 deleted the fix/listen-multihost-dsn branch May 21, 2026 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant