Charmander

Results 205 comments of Charmander

Correct, libpq already supports the feature. It’s the JS driver that doesn’t.

> Likewise sending **an object** to the PostgreSQL server via a query from node-postgres, node-posgres will call JSON.stringify on your outbound value, automatically converting it to json for the server....

@rightaway No, type parsers are for data coming from the PostgreSQL server. Serialization happens in [`utils.prepareValue`](https://github.com/brianc/node-postgres/blob/8f0db306d9676dd89aeb4b044f5e6402a85da2f0/packages/pg/lib/utils.js#L36-L69), and it doesn’t have parameter type information.

It needs working tests. If you can fix https://app.travis-ci.com/github/brianc/node-postgres/jobs/511426643, that’ll help.

something like ```sql INSERT INTO offers (user_id, created_at, public_at) SELECT user_id, now(), now() + INTERVAL '1 second' * delay FROM UNNEST ($1::uuid[], $2::int[]) AS t (user_id, delay) RETURNING id, user_id...

@PierBover `pool.connect()` acquires a client from the pool. It doesn’t serve to initialize the pool, and that example [leaks the resulting client](https://github.com/PierBover/fly-postgres-node-test/blob/9c125a04d362495acaec5e4b61869ec12d2d3b1a/index.js#L39). (If you do acquire a client *intentionally*, you...

@sgronblo You can always [override the `date` parser](https://github.com/brianc/node-pg-types#use) before pg-types is upgraded, note.

It’s not the parsing; it’s a serialization ambiguity. You need to serialize arrays as JSON manually when they’re top-level: ```js pg.query(`INSERT INTO test (field) VALUES ($1)`, [JSON.stringify([])]); ``` If the...

@Andrei-Stepanov There’s still no test. What configuration causes this error?

@Andrei-Stepanov Which is it? Connection is established when it should not be, or *Error: invalid sslmode value: "true"*?