porsager / postgres

Postgres.js - The Fastest full featured PostgreSQL client for Node.js, Deno, Bun and CloudFlare
The Unlicense
7.04k stars 257 forks source link

How to specify multiple hosts and ports in options #812

Closed lz000 closed 4 months ago

lz000 commented 4 months ago

I have seen some examples where I can specify an array of hosts to the host property in the options

postgres({
            host: ["host1", "host2"]
            database: "postgres",
            username: "",
            password: "",
            port: 5432,
        })

but this give me a type error host must be a string. I'd like to specify multiple host and port combos host1:5432, host2:5433. how to achieve this through options?