1

It seems that if I have key test1.test2 there is no way to escape this dot to use this key as is.

Expression:

sqlite> update collections set json_nodes = (select json_set(json(collections.js
on_nodes), '$.test.test1', json('123')) from collections);

will lead to

{"test":{"test1":123}}
Dmitriy
  • 5,525
  • 12
  • 25
  • 38

1 Answers1

1

For lookup, you can enclose the key name that contains a dot in double quotes. However, if your key name contains a double quote, I think you are out-of-luck unless you modify the source code to the JSON1 extension.

Escaping by double quote seems to be not documented, but you can see the way it works from the source code to the JSON1 extension, in the function jsonLookupStep.

Example:

SELECT json_extract(json_data, '$."Issuer.LongCompanyName"')
FROM instruments_table