code: function expandArrayPlaceholders(args){
  	var sql = args[0];
  	var params = args[1];
  	if (!Array.isArray(params) || params.length === 0)
  		return;
  	var assocLengthsOfArrayParams = {};
  	for (var i=0; i<params.length; i++)
  		if (Array.isArray(params[i])){
  			if (params[i].length === 0)
  				throw Error("empty array in query params");
  			assocLengthsOfArrayParams[i] = params[i].length;
  		}
  	if (Object.keys(assocLengthsOfArrayParams).length === 0)
  		return;
  	var arrParts = sql.split('?');
  	if (arrParts.length - 1 !== params.length)
  		throw Error("wrong parameter count");
  	var expanded_sql = "";
  	for (var i=0; i<arrParts.length; i++){
  		expanded_sql += arrParts[i];
  		if (i === arrParts.length-1) // last part
  			break;
  		var len = assocLengthsOfArrayParams[i];
  		if (len) // array
  			expanded_sql += _.fill(Array(len), "?").join(",");
  		else
  			expanded_sql += "?";
  	}
  	var flattened_params = _.flatten(params);
  	args[0] = expanded_sql;
  	args[1] = flattened_params;
  }
docs: expands IN(?) into IN(?,?,?) and flattens parameter array the function modifies first two memebers of the args array in place will misbehave if there are ? in SQL comments