SQLite Forum

Proposed JSON enhancements.
Login
To avoid having to wrap everything in json_valid calls, it would be nice to have an entry in the examples table of section 4.5 as follows :

'{"malformed:json}' -> '$.x') → NULL  (for malformed json on the -> operator, properly formed json required on the ->> operator)

Another argument for it is that it is closer to Postel's law.  In the -> case, a NULL return means x does not exist in the json, which is indeed the case for malformed json.  It just seems more robust.


In any event, that's all I'll say on this. :)