Skip to content

Conversation

@swamp-agr
Copy link

@swamp-agr swamp-agr commented Oct 29, 2025

This PR introduces a new conditional update tailored specifically for the situation when we need to update a field only if the new value is greater than existing one.

ON DUPLICATE UPDATE 
    x=IF(x < VALUES(x), VALUES(x), x)

See test for more details on how it works.

Minor thing: Main module for test suite was updated with FlexibleContexts extension because otherwise it won't compile (ghc 9.8.4)

Copy link

@mklinik mklinik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@swamp-agr swamp-agr merged commit 370c76e into persistent-mysql-haskell-9.2 Nov 6, 2025
0 of 5 checks passed
@swamp-agr swamp-agr deleted the extend-handle-update-collision branch November 6, 2025 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants