Skip to content

Conversation

@egalpin
Copy link

@egalpin egalpin commented Feb 7, 2018

If there is a way to do this by formatting a DSN in a way the urllib.parse can already handle, please feel free to document here and close this out. Thanks!

@elprans elprans self-requested a review March 4, 2018 01:11
Copy link
Member

@elprans elprans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Would you mind squashing the commits? Thanks!

@egalpin egalpin force-pushed the add-multi-host-dsn branch from 5832722 to f5654bd Compare March 5, 2018 14:25
@egalpin
Copy link
Author

egalpin commented Mar 5, 2018

Done 👍

Copy link
Member

@elprans elprans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, looking closer, I don't think the parsing is correct.

The general URI form is:

postgresql://[user[:password]@][netloc][:port][,...][/dbname][?param1=value1&...]

So, each comma-separated part has its own user/password/host/port tuple, while your implementation assumes that it's only the host part that is comma-separated sharing the other connection bits.

elprans added a commit that referenced this pull request Sep 19, 2018
The behavior matches that of libpq. Multiple hosts can now be specified in the DSN, e.g. `postgres://host1,host2:5433`. The `host` and `port` arguments now also accept lists. Like libpq, asyncpg will select the first host it can successfully connect to. Closes: #257 Related: #352
elprans added a commit that referenced this pull request Oct 23, 2018
The behavior matches that of libpq. Multiple hosts can now be specified in the DSN, e.g. `postgres://host1,host2:5433`. The `host` and `port` arguments now also accept lists. Like libpq, asyncpg will select the first host it can successfully connect to. Closes: #257 Related: #352
@elprans elprans closed this in #365 Oct 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants