Skip to content

Feature: ON DUPLICATE UPDATE x=IF(x < VALUES(x), VALUES(x), x) - #3

Merged
swamp-agr merged 1 commit into
persistent-mysql-haskell-9.2from
extend-handle-update-collision
Nov 6, 2025
Merged

swamp-agr merged 1 commit into
persistent-mysql-haskell-9.2from
extend-handle-update-collision

Conversation

@swamp-agr

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

Copy link
Copy Markdown

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)

@mklinik mklinik left a comment

Copy link
Copy Markdown

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.

2 participants