Hi, there seems to be a typo in the transactions documentation, in the first paragraph:
Because node-postgres strives to be low level an un-opinionated it doesn't provide
^ should be 'and'
And by the way thanks for the great library 😃
Another typo on https://node-postgres.com/features/pooling
// promise - checkout a client
pool.connect()
.then(client => {
return client.query('SELECT * FROM users WHERE id = $1', [1])
.then(res => {
client.release()
console.log(res.rows[0])
})
.catch(e => {
client.release()
console.log(err.stack)
})
})
should be
// promise - checkout a client
pool.connect()
.then(client => {
return client.query('SELECT * FROM users WHERE id = $1', [1])
.then(res => {
client.release()
console.log(res.rows[0])
})
.catch(err => {
client.release()
console.log(err.stack)
})
})
note the .catch(err => { bit
“and” was fixed at some point, the other is #1857.
Most helpful comment
Another typo on https://node-postgres.com/features/pooling
should be
note the
.catch(err => {bit