ModificationCommand.HandleJson hard-coded to send parameter with relational NULL for non-property partial update
- Dominant language
- C#
- Stars
- 14.8k
- Forks
- 3.4k
- PR merge metrics
- PR metrics pending
Description
In ModificationCommand.HandleJson(), there's a path for partially updating a single property, and another for updating a JSON fragment. For the latter, if the fragment is being set to null, a column modification will be generated with a value of (relational) NULL ([code](https://github.com/dotnet/efcore/blob/main/src/EFCore.Relational/Update/ModificationCommand.cs#L783)). This assumes that the database-specific partial update function accepts relational NULL, which is not always the case (PostgreSQL jsonb_set() requires a JSON null instead, and propagates relational NULL like most SQL functions).
The entire HandleJson() function is private, not allowing providers to override the behavior,
/cc @maumar
Contributor guide
Assessment
This issue has not been assessed yet.