MagicStack / MagicStack/asyncpg
Multihost bug when working with SqlAlchemy
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8.1k
- Forks
- 468
- PR merge metrics
- No merged PRs in 30d
Description
* **asyncpg version**: 0.24.0
* **PostgreSQL version**: 10
* **Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
the issue with a local PostgreSQL install?**:
* **Python version**: 3.9.6
* **Platform**: Doesn't matter
* **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](https://github.com/magicstack/uvloop)?**: doesn't matter
When we use asyncpg via sqlalchemy, we pass a dsn string to sqlalchemy and it parses this string and call asyncpg connect with host, port, username and etc instead of dsn. And it looks like asyncpg can't handle multiple hosts, separated by commas, passed in host param.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how SQLAlchemy parses the DSN and calls asyncpg with the host parameter, then reproduce the case with multiple comma-separated PostgreSQL hosts using the reported versions. Done means the multihost connection behavior works when SQLAlchemy passes the parsed host value to asyncpg.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, python, sqlalchemy
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 32/100