Hacker News new | ask | show | jobs
by simonw 2 days 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%...

A CHECK constraint only fails when the expression is false, NULL counts as passing.