SQLite should have (Rust-style) editions(mort.coffee)
307 points by gnyeki 14 hours ago | 140 comments
tl;dr: SQLite ships with several problematic defaults: foreign key constraints are ignored, columns don't enforce their declared types, concurrent writers immediately get SQLITE_BUSY errors instead of waiting, and performance-critical settings like WAL mode are off. The author proposes borrowing Rust's edition system: a single `PRAGMA edition = 2026` would opt into a modern set of sane defaults (strict tables, foreign keys, busy timeout, WAL) without breaking backwards compatibility for existing databases.
HN Discussion:
  • Praises the proposal for offering a concrete backwards-compatible solution rather than just complaints
  • Editions could break cross-version portability of SQLite database files between machines and tools
  • Loose typing is actually a valuable feature for handling messy real-world data
  • Precedents like JS 'use strict' show this approach works and can be repeated
  • The proposal oversimplifies issues, ignoring existing compile options and migration challenges for existing data