title: Easier way to update data with node-postgres?
body: <p>I'm using the superb plugin node-postgres, <a href="https://github.com/brianc/node-postgres" rel="noreferrer">https://github.com/brianc/node-postgres</a></p>
  
  <p>I have this update rest call. I have a about 30 columns in my in my table. Is there any easier way to update these then this way?</p>
  
  <pre><code>/*
   Post /api/project/products/:pr_id HTTP/1.1
   */
  exports.updateProduct = function(req, res){
    pg.connect(cs, function(err, client, done) {
      var query = "UPDATE products SET pr_title = ($1), pr_usercode = ($2) WHERE pr_id=($3)";
      client.query(query, [req.body.pr_title, req.body.pr_usercode, req.params.pr_id], function(err, result) {
        if (handleErr(err, done)) return;
        done();
        sendResponse(res, result.rows[0]);
      })
    });
  };
  </code></pre>
  
  <p>I only have three columns here. It will be messy and hard to maintain when I write all 30 columns. Must be a way where just with a simple line update all columns in req.body?</p>
  
  <p>Any ideas?</p>