Skip to content

fix(pg): restore lazy evaluation of $onUpdate callbacks in buildUpdateSet#5781

Open
hognevevle wants to merge 1 commit into
drizzle-team:mainfrom
hognevevle:fix/pg-on-update-fn-eager-evaluation
Open

fix(pg): restore lazy evaluation of $onUpdate callbacks in buildUpdateSet#5781
hognevevle wants to merge 1 commit into
drizzle-team:mainfrom
hognevevle:fix/pg-on-update-fn-eager-evaluation

Conversation

@hognevevle
Copy link
Copy Markdown

0.45.x introduced a regression where $onUpdate callbacks are invoked unconditionally for every column that defines one, even when an explicit value is provided in set. The callback result is then discarded via ??, but side effects in the callback always fire.

Restores the pre-0.45 behaviour: the callback is only invoked when the column is absent from set.

Fixes #5780

fix(pg): restore lazy evaluation of `$onUpdate` callbacks in `buildUpdateSet`

0.45.x introduced a regression where `$onUpdate` callbacks are invoked unconditionally for every column that defines one, even when an explicit value is provided in set. The callback result is then discarded via `??`, but side effects in the callback always fire.

Restores the pre-0.45 behaviour: the callback is only invoked when the column is absent from set.

Fixes drizzle-team#5780
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.

[BUG]: $onUpdate callback invoked eagerly in buildUpdateSet even when column is explicitly provided in set (regression in 0.45.x)

1 participant