brianc / node-libpq

Simple, low level native bindings to PostgreSQL's libpq from node.js
111 stars 41 forks source link

Feature Request: Multiple hosts in connection string with auto-switching #76

Open ghost opened 4 years ago

ghost commented 4 years ago

First of all thanks for great lib, pretty stable and fast!

There is already an issue opened here https://github.com/brianc/node-postgres/issues/1470#issuecomment-621702121

would it be a duplicate?

Anyway, HA comes to masses nowadays and middleware(pgpool, pbbouncer, haproxy) renders redundant starting with PosgreSQL v10 where libpq can switch between hosts.

And the "rude" question itself - any plans to implement this for node-libpq? :)

Seems it already supports multiple hosts, but getting error when providing the key param: ?target_session_attrs=read-write

[Error: invalid URI query parameter: "target_session_attrs"

with connection string:

postgresql://user@192.168.4.2,192.168.4.4:5432/database?target_session_attrs=read-write