Open asg017 opened 1 year ago
In horrifying news, TIL that SQLite allows nulls in primary keys!
I'm working through the consequences of that for Datasette here:
I don't think datasette-write-ui
should allow a primary key to be set to null
- that's very much not something that SQLite is proud of:
But it should ideally allow people to edit their null primary keys to fix them by setting them to something not-null.
Although it doesn't have the ability to edit primary keys at all, so maybe we just ignore this issue?
For null-able columns, each field should include a new "null" checkbox. If checked, the corresponding input (textarea, range slider, etc) should be hidden, and the value should be defaulted to NULL. If it is not check, the input element should be shown and whatever value there should take precedence.
For
NOT NULL
columns, the checkbox shouldn't even show up.