Skip to content

JSON: optimize update path for single property element - don't wrap the value in json array #30410

Closed

Description

Currently when updating single property inside json, we create parameter value as JSON array and put the value in it, then extract it in the update statement. This is because we want to guarantee the correct format of the value that we want to update (if we rely on database casting from a given type to string, we may end up in bad format and data gets corrupted. This only happens for some data types on sql server (guid, datetime, datetime offset) - so maybe we can special case. But need to look at Sqlite. Alternatively, if/when we have dedicated type mapping for json, we might be able to always generate parameter string value in correct format to be stored inside JSON.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    area-queryclosed-fixedThe issue has been fixed and is/will be included in the release indicated by the issue milestone.type-enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions