brianloveswords/streamsql — pull request #6 by christensenep (2013-12-16 21:14:41+00:00)
Title: [WIP] Modify mysql driver to reconnect after timeout

I ran into a problem when using streamsql with a heroku app using clearDb. Specifically, clearDb likes to time out connections every 60 seconds, and streamsql's mysql driver doesn't seem to handle this gracefully at the moment.

I was able to resolve the issue without changes to this library, but it gets pretty hacky, as you have to manually update db.connection, db.queryStream, and db.query. The updates to queryStream and query are necessary because, unfortunately, node-mysql doesn't seem to support reconnecting an existing connection.

This may not be a good solution, but I figured I'd submit it as a PR to illustrate the issue if nothing else.