MagicStack / MagicStack/asyncpg
Feature request: A connection property to retreive host name used in specific connection
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8.1k
- Forks
- 468
- PR merge metrics
- No merged PRs in 30d
Description
When multiples hosts are specified, either pool or connection could use any of them (depending on target_session_attrs).
It would be nice to have a way to retrieve the actual (connected) host name, as it was provided in the list, that was used to create a specific connection.
Currently, I found no easy way how to do this. Of course, it is possible to use `SELECT inet_server_addr()` but this only returns an address, which is not always useful.
Thank you!
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 reviewing asyncpg's connection and pool APIs, focusing on how multiple hosts and target_session_attrs select a connection. Define what the returned host name should represent, then verify the result against the host list for connections created through both supported paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, python
- Domain
- database
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100