| ▲ | simonw 5 hours ago | |
A handy trick for column types is check constraints. You can define constraints on a column that ensure it is text that's valid JSON for example:
Or to ensure specific keys:
You can even use this for things like enforcing a valid YYYY-MM-DD date, though that gets a bit convoluted: | ||
| ▲ | simonw 16 minutes ago | parent [-] | |
Correction to the above: it should use
Using = fails because a missing key returns null and in SQLite null = 'text' is null: https://latest.datasette.io/_memory/-/query?sql=select+null%... | ||