This is an abstraction layer built on https://github.com/felixge/node-mysql it add's various helper methods and helps deal with transactions.
var Connection mysql q;mysql =user: processenvMYSQL_USERhost: processenvMYSQL_HOSTpassword: processenvMYSQL_PASSWORDconnectionLimit: 100;Connection = mysqlconnection;//select then update using a transactionq = true;q//count the number of rowsq = ;q//fetch the first rowq = ;q
See tests/query.coffee for more usage examples
Note when deadlocks are automatically rolled back and queries are reissued any autoincrement columns aren't reverted, see http://stackoverflow.com/questions/14758625/mysql-auto-increment-columns-on-transaction-commit-and-rollback for more details
There is a crude stats collection via the connection.stats prameter which counts the number of select/update/delete/insert queries per connection, you can disable stats collection by setting connection.gatherStats to false