3 ms·
Correction to the above: it should use json_type(data, '$.name') IS 'text' Using = fails because a missing key returns null and in SQLite null = 'text' is n
by simonw 3mo ago
Correction to the above: it should use
json_type(data, '$.name') IS 'text'
Using = fails because a missing key returns null and in SQLite null = 'text' is null: https://latest.datasette.io/_memory/-/query?sql=select+null%2C+%27text%27%2C+null+%3D+%27text%27%2C+null+is+%27text%27%2C+json_extract(%27%7B%7D%27%2C+%27%24.key%27)+is+null%2C+json_extract(%27%7B%7D%27%2C+%27%24.key%27)+%3D+%27text%27%2C+json_extract(%27%7B%7D%27%2C+%27%24.key%27)+is+%27text%27 https://latest.datasette.io/_memory/-/query?sql=select+null%...
A CHECK constraint only fails when the expression is false, NULL counts as passing.