带有JS驱动程序的node js postgres pg libary multihost支持

寻找任何nodejs Postgres JS驱动程序或逻辑来处理多主机数据库支持。

下面尝试使用pg库和连接字符串作为DB URL的解析,但是在JS驱动程序方面失败。

const conn = new ConnectionString('postgres://server1.site1.company.com:1512,server2.site2.company.com:1512/dbname?target_session_attrs=read-write');
conn.setDefaults({user:'user',password:'password'});

但是失败,如下所示

(node:13772) UnhandledPromiseRejectionWarning: error: database ":1512,server2.site2.company.com/dbname" does not exist
    at Connection.parseE (node_modules\pg\lib\connection.js:604:13)
    at Connection.parseMessage (node_modules\pg\lib\connection.js:403:19)
julia_cm 回答:带有JS驱动程序的node js postgres pg libary multihost支持

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2553175.html

大家都在问