[odb-users] odb (2.3.0) with MySQL sql-mode NO_AUTO_VALUE_ON_ZERO

Boris Kolpackov boris at codesynthesis.com
Wed Mar 22 12:58:51 EDT 2017


Hi,

Пустовалов Дмитрий <pustovalovdmit at gmail.com> writes:

> I use MySQl with enabled sql-mode NO_AUTO_VALUE_ON_ZERO, which means that
> it's not possible to use 0 in INSERT statements for PK column to indicate
> MySQL that it should automatically assign value for PK.
> 
> Is there some way to force odb compliter to generate proper SQL-code
> because I don't want to disable NO_AUTO_VALUE_ON_ZERO?

Not at the moment. But we had a similar issue with SQLite which was
addressed by allowing NULL values for auto ids. Here is the commit:

http://scm.codesynthesis.com/?p=odb/odb.git;a=commit;h=4fd2c107242fe9f8e6ba7ded2a789f4de2ccd040

Perhaps we could do the same for MySQL?

Boris



More information about the odb-users mailing list