Node-postgres: Typo in documentation

Created on 1 Nov 2017  ·  2Comments  ·  Source: brianc/node-postgres

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 😃

Most helpful comment

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

All 2 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gpanainte picture gpanainte  ·  3Comments

dindurthy picture dindurthy  ·  4Comments

v1co1n picture v1co1n  ·  4Comments

ossdev07 picture ossdev07  ·  3Comments

frmoded picture frmoded  ·  3Comments