Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- proto.queryRow = function(sql, args){
- this.client.queryAsync = this.client.queryAsync || Promise.promisify(this.client.query);
- return this.client.queryAsync(sql, args).then(function(res) {
- if (res.rows.length) return res.rows[0];
- if (res.rowCount) return res.rowCount;
- throw new NoRowError();
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement