SQLite Forum

JSON literals, how they work
Login
Hi all,

I'm wondering about why these queries return what they return. I would expect them all to return the same thing, the first result:

sqlite> select json_set('{}','$.t',json('true'));
{"t":true}

sqlite> select json_set('{}','$.t','true');
{"t":"true"}

sqlite> select json_set('{}','$.t',CAST('true' as JSON));
{"t":0}

How does it work?

Wout.