nodejs module: write chaining sql and execute it