5 ms·
My beef with SQLite is the weaker typing + not even enforcing foreign keys unless you open the DB in a certain mode. IMO it should become more opinionated and
by pdimitar 3y ago
My beef with SQLite is the weaker typing + not even enforcing foreign keys unless you open the DB in a certain mode.
IMO it should become more opinionated and stricter. I'd honestly pay to buy a license for SQLite with the legacy baggage removed and rewritten to be as strict as PostgreSQL or more. Well... basically embedded PostgreSQL I guess.
- markusw 3y agoI also don’t like those parts, but for an otherwise great project, I’d happily use the parts I do like. Strict tables go a long way for me, and you can make foreign key checks a compile-time enforcement.
- pdimitar 3y agoAgreed, plus check my other sibling comment: https://news.ycombinator.com/item?id=39681241 https://news.ycombinator.com/item?id=39681241
- sgarland 3y agoSame. I’ve been using it in a project, and the entire time I feel like I’m needing to be twice as careful not to introduce problems.
- pdimitar 3y agoYep, I am even considering writing a Rust library that does opinionated opening of SQLite databases with FK enforcing turned on, strict tables and other such goodies, and making sure dates / times and such are properly (de)serialized so we can have some convention inside SQLite itself (f.ex. fully ISO formatted datetimes with or without timezones).
- markusw 3y agoHa, I’ve started the same thing in Go, but didn’t get that far. https://github.com/maragudk/sqlite https://github.com/maragudk/sqlite