SQLite JSON_PATCH() Function
Example
Merge two JSON objects:
SELECT JSON_PATCH('{"a": 1, "b": 2}',
'{"b": 3, "c": 4}');
Try it Yourself »
Definition and Usage
The JSON_PATCH() function merges a patch into a JSON object, and returns the result. Values in the patch replace or add values in the target. A value of null in the patch removes the value.
Note: Read more about JSON in the SQLite JSON chapter.
Syntax
JSON_PATCH(target, patch)
Parameter Values
| Parameter | Description |
|---|---|
| target | Required. The JSON object to change |
| patch | Required. The JSON object with the changes |
Technical Details
| Return type: | Text |
|---|