[DBIx-Class-Devel] Re: [sql-translator] People/rporres/sqlite autoincrement (#26)

Peter Rabbitson notifications at github.com
Sun Nov 3 12:49:14 GMT 2013


@rporres Just chiming in briefly to restate the problem, as doesn't seem to have been voiced in this discussion:

* By default SQLite provides autoincrement via an alias to ROWNUM - this is performant, guarantees uniqueness, and does *NOT* guarantee monotonic increase
* Your change makes *all* sqlite autoincs proper ANSI-sql autoincs - slower, unique and monotonically increasing

The problem: there is likely a vast amount of software both on CPAN and on Darkpan which has tests and business logic assumptions based on the ROWNUM-aliased semantics. Hence this is a very disruptive change that had to be quickly backed out.

The possible solutions all circle around these criteria: 

* A silent change of behavior like this is not an option. Folks need to have at least a *year* of clear warning that the behavior is going to be changing
* The behavior needs to be switchable - folks should be able to select the less correct but more performant behavior (it is even recommended by the SQLite documentation). I suggest some sort of general SQLite-producer specific producer_flag. Something like `autoinc_method => [ rownum | sequence ]`, with the default being 'rownum' and being changed in a year to 'sequence'
* The breakage (behavior change) should be introduced a bit sooner on AUTOMATED_TESTING=1 so that cpantesters can highlight the downstream fallout

I think this should make for a smooth transition towards an "everybody wins" scenario.

Cheers

---
Reply to this email directly or view it on GitHub:
https://github.com/dbsrgits/sql-translator/pull/26#issuecomment-27643998
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class-devel/attachments/20131103/e9369d1e/attachment.htm


More information about the DBIx-Class-Devel mailing list