launchbadge / sqlx

🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, and SQLite.
Apache License 2.0
13.46k stars 1.28k forks source link

[Postgres] Support multiple hosts #179

Open mehcode opened 4 years ago

mehcode commented 4 years ago

Blocked by #174

It is possible to specify multiple hosts to connect to, so that they are tried in the given order.

postgresql://host1:123,host2:456/somedb
Razican commented 2 years ago

Hello, how could I help to make this happen? Also, if one of the hosts goes down in the middle of the runtime, would the connection pool automatically try the second one until the first becomes available again?

MTRNord commented 1 year ago

Hi any update on this? I tried also the syntax in https://www.postgresql.org/docs/current/libpq-connect.html but that results in a ParseIntError { kind: InvalidDigit })