Create a wrapper for client.query, returning one data parameter with both results.
client.prototype.query2 = function ( sql, callback ) {
this.query(sql,
function(err, results, fields) {
var data={result:result, fields:fields};
callback(err,data);
}
};
I've recently created simpler abstraction than 'futures', also based on Fibers. I haven't tested my code with a real world DB example yet. Please try it and help me test it if you can: https://github.com/luciotato/waitfor