4 ms·
Right, and that's the problem. There should be DATE and BOOL as well, especially in strict mode.
by petilon 3mo ago
Right, and that's the problem. There should be DATE and BOOL as well, especially in strict mode.
- asa400 3mo agoYeah the parse rules for strict tables are annoying but it doesn't change the underlying semantics: sqlite> create table test ( id integer primary key, created_at text default current_timestamp, flag integer not null default 0 check (flag in (0, 1)) ) strict; sqlite> insert into test (flag) values (1); sqlite> select * from test; ╭────┬─────────────────────┬──────╮ │ id │ created_at │ flag │ ╞════╪═════════════════════╪══════╡ │ 1 │ 2026-07-12 04:03:22 │ 1 │ ╰────┴─────────────────────┴──────╯
- mort96 3mo agoI don't understand what this has to do with strict mode? Yes those types should exist, but the workaround is to use an integer column for bool and a text column for date, whether or not you're using strict mode.
- petilon 3mo agoThe point of strict mode is that the RDBMS performs data type validation when inserting/updating data. If you use a text column for storing dates, you can store any string in the column, not just valid dates. That's not strict.