Open MaximusMcCann opened 5 months ago
I'm seeing very broken behavior with upsert, possibly related. I have a trigger that checks if the incoming NEW.version < OLD.version
to reject updates from clients without the latest data. When I use upsert NEW.version
is somehow set to the wrong value even though I've verified that the data I pass to upsert is correct! I pass { ...rest_of_record, version: 4 }
to upsert and my trigger fails because NEW.version
is 1
not 4
.
Bug report
Describe the bug
I want to bulk
update
, but must useupsert
. I useupsert
but receive issues on non-null columns when they are not provided, despite the value existing on the record in the db.To Reproduce
Example table:
Updating a single row (via
upsert
): I know the record exists and thename
column is populated. However if I try toupsert
:I receive
Expected behavior
The row show be "merged", thus it should just update the two columns I provided, and not default the
name
column to null, which in this case is not allowed.