include sql command when sql/programmer error raised
You can try logging: http://docs.peewee-orm.com/en/latest/peewee/cookbook.html#logging-queries

Or you can implement `Database.sql_error_handler` http://docs.peewee-orm.com/en/latest/peewee/api.html?highlight=sql_error_handler#Database.sql_error_handler

Please comment if you find that this is an error in peewee.

Hi,
I have tens or hundreds of thousands of rows to commit (MySQL) and I had db connection issues when trying to commit them all in one go.  The data is provided by a generator and I take slices (itertools.islice) that are passed in to an insert_many(...).execute() call.

When calling insert_many(...).execute() for the second time an sql/programmer exception is raised.  I initially thought this was just because the generator was exhausted, but after writing unit tests (well, I wrote units for in memory sqlite, but the real code is connecting to mysql) I see that peewee handles this ok.

It's strange to me that insert_many(...).execute() works the first time but not the second.  If I could see the sql that fails it could be useful.

Any help/advice appreciated.
