Created
January 22, 2014 19:35
-
-
Save niczak/8565794 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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