You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[SQLite] Allow ExecuteUpdate updating of JSON properties to arbitrary relational expressions #36688
#28766 added support for partial updating of JSON properties via ExecuteUpdate. One thing that isn't yet supported is updating such properties to arbitrary relational expressions:
_=awaitExecuteUpdateAsync(b =>b.SetProperty(x =>x.JsonColumn.Foo, x =>x.JsonColumn.Bar+j.JsonColumn.Baz)
This also includes setting the JSON property to a regular, non-JSON colum:
_=awaitExecuteUpdateAsync(b =>b.SetProperty(x =>x.JsonColumn.Foo, x =>x.Bar)
The reason for this limitation is that the database functions which perform partial JSON updates (e.g. JSON_MODIFY/modify on SQL Server) accept JSON types, i.e. string/int/bool; all other relational types, need to be converted to their JSON representation. While we can do that client-side for simple constants and parameters (via JsonValueReaderWriter), and can even support setting a JSON property to another JSON property (the JSON string representation can simply be copied), for anything else we need to convert the relational value to the correct JSON representation server-side.
On SQL Server, this can be done with JSON_OBJECT() as follows (implemented in #36730):
changed the title [-]Allow ExecuteUpdate updating of JSON properties to arbitrary relational expressions[/-][+][SQLite] Allow ExecuteUpdate updating of JSON properties to arbitrary relational expressions[/+]on Sep 9, 2025
Note that this is being done on SQL Server via #36730; keeping this issue to track SQLite support.
SQLite is a bit trickier, since it has very little actual types - we map e.g. DateTime to a string in the database. Now, we could simply copy the source non-JSON string into the JSON document, with the assumption that it's the same (e.g. an ISO8601 string), but that's not always going to be the case. For example, M.D.Sqlite also supports mapping timestamps to ints/floats, and we don't want to just copy that into JSON documents.
To do this correctly and reliably, this ultimately may require a type-by-type solution, checking how (and where) we can convert. Do this after #36729, which would move the server-side JSON serialization logic to the type mappings.
Activity
Support arbitary values in ExecuteUpdate JSON for SQL Server
Support arbitrary values in ExecuteUpdate JSON for SQL Server
[-]Allow ExecuteUpdate updating of JSON properties to arbitrary relational expressions[/-][+][SQLite] Allow ExecuteUpdate updating of JSON properties to arbitrary relational expressions[/+]roji commentedon Sep 9, 2025
Note that this is being done on SQL Server via #36730; keeping this issue to track SQLite support.
SQLite is a bit trickier, since it has very little actual types - we map e.g. DateTime to a string in the database. Now, we could simply copy the source non-JSON string into the JSON document, with the assumption that it's the same (e.g. an ISO8601 string), but that's not always going to be the case. For example, M.D.Sqlite also supports mapping timestamps to ints/floats, and we don't want to just copy that into JSON documents.
To do this correctly and reliably, this ultimately may require a type-by-type solution, checking how (and where) we can convert. Do this after #36729, which would move the server-side JSON serialization logic to the type mappings.
Support arbitrary values in ExecuteUpdate JSON for SQL Server
[rc2] Support arbitrary values in ExecuteUpdate JSON for SQL Server (#…