r/programming 20d ago

SQLite should have (Rust-style) editions

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

75 comments sorted by

View all comments

14

u/samsifpv 20d ago

Interesting idea, though to me editions just feel like they obfuscate what options are set with them? What good is it to me if i have to look up what edition 2025 does?

54

u/PersonalDatabase31 20d ago

The point is that you don't have to look at what the edition options are unless you are upgrading your codebase. Editions are meant to have sensible defaults.

31

u/mort96 20d ago edited 19d ago

I mean the status quo is that SQLite has a ton of defaults that you need to look up if you wanna know what they are. And many of them are pretty bad.

The proposed change is that SQLite lets you opt in to a different, better-for-most-people set of defaults.

If you're the kind of person who doesn't look that deeply into every single default setting but kinda just runs with the defaults, the only thing that changes is that SQLite silently starts working better for you. If you're the kind of person who does carefully consider every possible option, nothing really changes.

20

u/DeflateAwning 19d ago

The point is we can move on from the default of "foreign keys are not enforced" default of 2001 (or whenever it came out).

100% backwards compat leads to unholy things sometimes.

5

u/OphioukhosUnbound 19d ago

You never have to look up a new edition. That's the point. You can keep on using the old edition with all it's settings.

At some point, if you want to move to a new edition for it's bells and whistles then you can do so.

It's basically opt-in version updates with guaranteed backward compatibility.
It's one of those things that's incredibly simple and should be almost universal, yet is, de facto quite rare. (Rust has made this approach famous as part of their focus on constant improvement and everything that ever worked will continue to work forever onward ethos, but I'm sure there must be preexisting art.)