SQL generation for node.js