SQLite should have (Rust-style) editions

315 points · 144 comments on HN · read original →

Points and comments are a snapshot, not live.

SQLite should adopt Rust-style editions to fix its bad defaults without breaking backward compatibility.

The article argues SQLite's defaults are wrong: foreign key constraints are ignored, columns accept any data type, SQLITE_BUSY errors occur with concurrent writers, and WAL is disabled. The author proposes a PRAGMA edition = 2026 that sets foreign_keys=ON, busy_timeout=5000, journal_mode=WAL, synchronous=NORMAL, and makes strict tables default. This Rust-inspired system allows new defaults without breaking existing software, and future editions could incorporate further improvements.

What commenters are saying

The author participated, accepting a minor correction about ROWID reuse. Commenters broadly agreed on the bad defaults but debated the editions approach. Some worried about breaking forward compatibility when older SQLite versions read databases created with a newer edition. Others countered that editions are just a pragma mapping and don't change the file format, so compatibility is the same as setting individual pragmas. A reference to SQLite's forum discussion on strict tables was noted.