https://kotlinlang.org logo
#komapper
Title
# komapper
d

dave08

11/07/2023, 2:59 PM
It seems like h2 mysql compatibility mode might not be supported in komapper? It says (in h2 docs on mysql compatibility):
• ON DUPLICATE KEY UPDATE is supported in INSERT statements, due to this feature VALUES has special non-standard meaning is some contexts.
• INSERT IGNORE is partially supported and may be used to skip rows with duplicate keys if ON DUPLICATE KEY UPDATE is not specified.
whereas komapper seems to use
merge into using
that cause funny errors that the table EXCLUDED doesn't exist... maybe there should be
H2Dialect(mode: H2CompatibilityMode)
...?
It seems to work perfectly with the MySql57Dialect I made!!! So I guess that kind of setting should only be necessary if Komapper uses things that are unsupported by h2's compatibility modes...
But that's another ❤️👍🏼 for Komapper to be able to use dialects like that!
t

Toshihiro Nakamura

11/08/2023, 10:00 AM
Komapper does not support the MySQL compatibility mode of H2. We believe that it is a very rare use case.
d

dave08

11/08/2023, 10:31 AM
Rare? Anybody unit testing for something running mysql in production, would benefit from a light weight h2 mysql compatibility...
t

Toshihiro Nakamura

11/08/2023, 12:20 PM
If the MySQL compatibility mode of H2 has sufficient compatibility, you can use the
MySqlDialect
.
d

dave08

11/08/2023, 12:22 PM
Yeah, that's what I did in the end, and it seemed to work (at least for my basic needs)... but if you try to run your existing unit tests for mysql dialect on h2, we'd know how much support there really is...
Then at least you can put that possibility in the docs... which I think is a very important feature for people.
Although I didn't use your dialect for 8, instead I used my temporary one for 5.7, so I'm not sure if 8 is supported even in my use cases.