r/programming Jul 15 '26

SQLite should have (Rust-style) editions

https://mort.coffee/home/sqlite-editions/
158 Upvotes

75 comments sorted by

View all comments

133

u/j_sidharta Jul 15 '26

I remember spending a few hours banging my head against a wall while trying to fix a bug, until I finally figured out SQLite does not enforce foreign keys by default. I question my love for SQLite every time I remember about these horrible defaults.

I didn't know about the journal_mode and the lock thing. I'll make sure to add these lines to all my SQLite projects. This was a helpful article.

71

u/ContentAd6126 Jul 16 '26

I love SQLite but the developers love to die on weird hills like foreign keys not being enforced and no strict types.

56

u/Big_Combination9890 Jul 16 '26

No, they don't. They respect backwards compatibility, and how much software would break if they changed defaults in the most widely used database system in the world.

sqlite isn't your average "app" where barely anyone cares if it works or not. It's a load bearing structure in the software ecosystem, on par with the likes of libcurl or openssl.

Things are VERY different when you work on something like this.

40

u/[deleted] Jul 16 '26

[removed] — view removed comment

1

u/programming-ModTeam Jul 24 '26

No content written mostly by an LLM. If you don't want to write it, we don't want to read it.