Shorten my asynchronous DB queries, using async.js module I am using


Node.js
Express.js
node-mysql.js
async.js


I am making multiple asynchronous queries to my DB, but every query relies on the previous one's results, so I decided to use the waterfall method.  

Right now, my code looks like this (I simplified it with only 2 queries, but there are more):

async.waterfall([
    function(cb){
        db.query(insertQuery,values,cb);
    },
    function(results,_,cb){
       var lastInsertId = results.insertId;
       db.query(anotherInsertQuery,otherValues.concat(lastInsertId),cb);
    }
],callback);


But I found my code a bit messy, especially the function(cb) { ... } wraps. 

Is there a way to get rid of those annoying function(cb){...} ?
I think not.

Whereas you find the function(cb) { ... } wraps a bit messy, I think that this is the most elegant way to show readers that this is a separate functions, and that stuff is about to get asynchronous.. Again, compared to other approaches, this is quite clean.

Also, (I know this is just a small example), consider not using the lastInsertId variable. You could simply go for 

async.waterfall([
    function(cb){
        db.query(insertQuery,values,cb);
    },
    function(results,_,cb){
       db.query(anotherInsertQuery,otherValues.concat(results.insertId),cb);
    }
],callback);