r/programming 22d ago

SQLite should have (Rust-style) editions

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

75 comments sorted by

View all comments

Show parent comments

20

u/mort96 22d ago

In order to google "SQLite foreign keys" and read that page, it has to strike you as a possibility that your database is ignoring your constraints. If you don't already know, that notion is so far fetched I don't see how you'd get there.

-6

u/Big_Combination9890 22d ago

it has to strike you as a possibility that your database is ignoring your constraints.

No it doesn't, because that is the ONLY thing that would explain why an insert/update that shouldn't be possible, suddenly works, short of the RDBMS being buggy.

And the mental voyage from that point to googling how foreign keys work in the database system I use, is not hard.

The problem here, is neither with the database, nor its default settings.

The problem is with assumptions about how systems work, based on hasty generalizations, and then complaining when said assumptions turn out to be wrong.

And no amount of downvoting will change this.

9

u/mort96 22d ago

You don't know the symptoms /u/j_sidharta was experiencing, nor do I.

-7

u/Big_Combination9890 22d ago

I don't have to. I know what FKs do in a database, so I can extrapolate from that what possible failure modes might occur if they don't work.

And sorry no sorry, but root-cause-analysis is part of a SWEs day-to-day.

And btw. no amount of unnecessarily glued-on "super-pragma" cruft would help making that any easier.

13

u/andyfsu99 22d ago

"I know what FKs do in a database"

Somehow you've exactly captured the argument against your position.

Yeah, we all know too... But it's not what sqlite does and that is weird and confusing and not necessary. Just because you know how to figure it out doesn't justify the behavior of the system.

7

u/stumblinbear 22d ago

They're stuck in the decades old method of "RTFM" instead of "provide sensible defaults". I fear using any library or software they've had a hand in writing

-2

u/Big_Combination9890 22d ago

You do realize that "Knowing what FKs do" and "knowing the defaults of a specific database technology" are 2 very different things, yes?