Handler for mysql connections in node.js