Skip to content

Instantly share code, notes, and snippets.

@niczak
Created January 22, 2014 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niczak/8565794 to your computer and use it in GitHub Desktop.
Save niczak/8565794 to your computer and use it in GitHub Desktop.
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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment