Just had this same issue. Move the connection.close into your execute function. Because this is Node and things are running non blocking, it is closing your connection before the results are sent back.