function getRow(id) { var dfd = Q.defer(); var query = db.query('SELECT * FROM table WHERE lookUp = ?', id, function(err, result) { if(err) { dfd.reject(err); } else { dfd.resolve(result); } }); return dfd.promise; }