Earlier quoted context omitted.
SQLite is used in a lot of unconventional settings (for SQL databases) where these settings don't make as much sense. But that's what makes the "edition" useful; it captures the use case we all mean when we're thinking of the "database" lego in an application stack.
While that's true, editions are more about leaving legacy decisions behind while keeping the backward compatibility promise. Even if you're in one of those unconventional settings (say, a bare-metal microcontroller or something), you'd probably still start from edition 2026 and mutate your settings accordingly, rather than using the defaults that are 26 years old.
SQLite should have (Rust-style) editions
121–130 of 186 posts
Re: SQLite should have (Rust-style) editions
#122Earlier quoted context omitted.
You are probably correct, but I imagine the SQLite team's dedication to backwards compatibility has things the way they are so that existing systems can user later versions a swap without worrying about changing the SQL using it.
If they’re opt-in, how could the new defaults be a problem for backwards compatibility?
Given how many projects are potentially out there effectively relying on the current settings, and SQLite's general attitude to backwards compatibility, that would likely not be considered a good idea. Opting in with an edition flag for new (or updating) projects does seem like a good solution to this to serve all of old, active, and new projects, but it would increase potential bug surface area and therefor testing requirements, and the existing setting do allow all that to be opted in/out to/from already (and it is only four settings we are talking about here).
That FKs being enforced is set per-connection rather than at the database level is something that surprised me a lot when I found out. A way of setting that at DB creation (or via ALTER DATABASE after) seems like quite an omission because if you have multiple potential routes that can update the same DB any one of them could cause serious the others will encounter.
Re: SQLite should have (Rust-style) editions
#123Earlier quoted context omitted.
I agree with you. There are 2 dozen foot-guns to be kept in mind. And discovered a new footgun regarding multi-byte strings and NUL handling today on HN. SQLite became popular because it was the only free and open-source choice 2 decades ago. Now there are other type-safe and robust choices.
What are other choices for FOSS serverless relational databases? I’ve been looking everywhere and couldn’t find anything.
It's a fully featured database though, with everything you expect from one, including actually working ALTER TABLEs.
Re: SQLite should have (Rust-style) editions
#124Earlier quoted context omitted.
What are other choices for FOSS serverless relational databases? I’ve been looking everywhere and couldn’t find anything.
DuckDB ? Strict by default and excellent for logs, telemetry, dashboard apps, etc.
Re: SQLite should have (Rust-style) editions
#125Earlier quoted context omitted.
I don’t understand why a local app database shouldn’t still have the same basic functionality and data guarantees as the full-sized ones.
You can just run postgresql locally like akonadi does if that's what you need
Re: SQLite should have (Rust-style) editions
#126Re: SQLite should have (Rust-style) editions
#127Earlier quoted context omitted.
> The normal ROWID selection algorithm described above will generate monotonically increasing unique ROWIDs as long as you never use the maximum ROWID value and you never delete the entry in the table with the largest ROWID. If you ever delete rows or if you ever create a row with the maximum possible ROWID, then ROWIDs from previously deleted rows might be reused when creating new rows and newly created ROWIDs might…
What should it do once you hit MAXINT? Honest question…
I would suggest if you are storing that much data, SQLite may not be the correct engine. (And you probably shouldn't be using an Int primary key.)
It's a good question to ask, but probably not a concern for most of us.
Re: SQLite should have (Rust-style) editions
#128Re: SQLite should have (Rust-style) editions
#129> But I do not recall a single instance where the bugs might have been caught by a rigid type system.
Which is a shame. Of course the author writes more than this, but this is IMO largely the gist of the argument. At this point it's beginning to feel like this is mostly a sort of stubborn sunken cost fallacy, where they've been arguing this for so long they can't take the "hit" of agreeing to change the defaults.
Re: SQLite should have (Rust-style) editions
#130Sadly, the ORM layer lags here: Drizzle has no way to declare STRICT tables. The request has been open since March 2023 (issue #202, now discussion #2435) and didn't make the v1.0 beta either. The only workaround is hand-appending STRICT to generated migration SQL, which doesn't work at all if you use `drizzle-kit push`. https://github.com/drizzle-team/drizzle-orm/discussions/2435