Live data from Hacker News

SQLite should have (Rust-style) editions

mort.coffee

81–90 of 186 posts

Re: SQLite should have (Rust-style) editions

#81
post #17

In the first example, there's a a second thing that surprised me: you delete an entity and it's unique ID gets reused? Is that a good idea? I guess if foreign keys are handled properly then that's not a problem by definition? But it sounds wrong somehow.

>> you delete an entity and it's unique ID gets reused? Is that a good idea? That's default behavior, but it can be altered when creating a table. See; https://sqlite.org/autoinc.html

Where do you see that they get reused from that link?

Re: SQLite should have (Rust-style) editions

#82

HN… for the love of god… please please stop trying to make SQLite be something it isn’t. Leave this poor project alone. It’s a great tool if you want to give a local app its own database. If you need concurrent writes and full ACID guarantees of an industrial strength database, use an industrial strength database. Yes, other databases will require you to read more manual pages and configure a service. Higher up front…

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

#87
post #81

Earlier quoted context omitted.

>> you delete an entity and it's unique ID gets reused? Is that a good idea? That's default behavior, but it can be altered when creating a table. See; https://sqlite.org/autoinc.html

Where do you see that they get reused from that link?

> 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 not be in strictly ascending order.

Re: SQLite should have (Rust-style) editions

#88
post #35
post #17

In the first example, there's a a second thing that surprised me: you delete an entity and it's unique ID gets reused? Is that a good idea? I guess if foreign keys are handled properly then that's not a problem by definition? But it sounds wrong somehow.

I think that's a security vulnerability. If a parent table ID gets reused, then it's a potential to expose data to a wrong user -- security broked.

That's correct but SQLite was never designed to be a production database in the first place. It can be used as a production database but only if you know what you're doing, and presumably anyone who knows what they're doing knows about the AUTOINCREMENT keyword because it's one of the first things you learn about SQLite.

Re: SQLite should have (Rust-style) editions

#89
Oh I really like this! The one counterargument that comes to mind is when I think about the likes of C++, where there are many editions and they can be confusing to keep track of.

I'm not sure if you'd want to set one edition in stone every year. Perhaps every 3 years? Or 5 years? Especially for a long-term project like SQLite, that sounds perfectly acceptable!

Re: SQLite should have (Rust-style) editions

#90
post #63

Why not a .conf file like everything in /etc or postgresql.conf?

SQLite isn't typically a global one-per-system database, and even if it was how would that solve this problem? The problem isn't that you can't set all these settings to the right values - it's that they don't have the right values by default.
Post reply on HN