SQLite Forum

Proposed JSON enhancements.
Login
As far as the core SQLite is concerned, -> and ->> are new undefined
operators (kind of like REGEXP) that the parser converts into two-argument
SQL functions with the same name as the operator.  To complete the magic,
the JSON1 extension then defines new
extension functions using sqlite3_create_function() named "->" and "->>".

Your application can overload these extension functions.
You can define your own SQL functions functions named "->" and "->>"
that do whatever you want.  You can also write crazy SQL like this:

> ~~~
SELECT "->>"('[1,2,3,4]',2);
~~~

Which generates exactly the same AST as the more readable:

> ~~~
SELECT '[1,2,3,4]' ->> 2;
~~~

The "n" prefix means "no-errors".  Or it means "null-if-error".  Whatever
works for you.  I'm open to better name suggestions.