Advertisement
Guest User

Untitled

a guest
Jan 13th, 2014
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. proto.queryRow = function(sql, args){
  2.         this.client.queryAsync = this.client.queryAsync || Promise.promisify(this.client.query);
  3.         return this.client.queryAsync(sql, args).then(function(res) {
  4.                 if (res.rows.length) return res.rows[0];
  5.                 if (res.rowCount) return res.rowCount;
  6.  
  7.                 throw new NoRowError();
  8.         });
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement