dresende/node-orm2 — pull request #185 by esk525 (2013-06-04 14:12:55+00:00)
Title: mysql driver fix for non auto-increment primary key

Fixes issue when using non auto-increment primary key with the mysql driver and adds a test for the issue.

Issue remains for sqlite. Fix for sqlite appears to be non-trivial as, unlike the mysql driver, a valid value of 1 is returned by sqlite driver for the last_row_id value. In order to determine if the last_row_id value should be applied, more details about the column definition are needed before line [151](https://github.com/dresende/node-orm2/blob/master/lib/Drivers/DML/sqlite.js#L151) of ```lib/Drivers/DML/sqlite.js``` in function ```Driver.prototype.insert```. Without the column definition, I suspect any 'fix' would be more of a 'hack' than a fix.

I believe the mysql and sqlite drivers will both fail without column definition details in the case where a model has 2 primary keys with one of them being an auto-increment field. I will need to build a test case for this to be sure though.