Open tim2CF opened 2 years ago
This seems like it should be doable, looks like persistUniqueToFieldNames
and persistUniqueToValues
should allow for us to generate a default where clause. I am not particularly familiar with the expected behavior here though. Is there ever a reason the where clause should be anything other than matching the Unique rec
value?
Error was found in esqueleto 3.5.3 from hackage. To reproduce, you need to apply expression similar to
And then error will look like
Expected behaviour - atomic insert in case where Unique key was not used yet, and ignore (no update) in case Unique key has been already used.
There is a workaround to avoid such error and get expected behaviour - you need to do redundant update of Unique key like this:
But in my opinion it should work as expected without any workarounds.