Dev Helpers
← Back

Patch one nested preference

Patch one nested preference using SQLite JSON functions.

Open this example in the interactive library

Source code

SELECT json_set('{"theme":{"mode":"dark","scale":1}}','$.theme.scale',2) AS preferences;

Sample output

[
  {
    "preferences": "{\"theme\":{\"mode\":\"dark\",\"scale\":2}}"
  }
]