News for hackers. Stuff that matters.
Re:Why you should probably be using SQLite by euroderf on Friday October 27, 2023 @08:58AM (#38037831)
> foreign keys are ignored by default

This can be fixed in the connection string.

> column types are not checked

Now available, the STRICT keyword.

Re:Why you should probably be using SQLite by rrdharan on Friday October 27, 2023 @09:07AM (#38037919)
Coercion isn’t necessarily what you want. See discussion here (when STRICT was introduced):

https://news.ycombinator.com/item?id=28259104

It’s also only two years old which is forever in the web world and brand new by Databases ops/maturity standards. There are likely still warts waiting to be discovered (there always are, but the discovery rate tapers over decades).

Re:Why you should probably be using SQLite by graemep on Friday October 27, 2023 @11:28AM (#38039774)
> This can be fixed in the connection string.

Not a solid guarantee. More prone to bugs, errors, etc. What is someone changes something using the comnandline client and forgets to issue the pragma command?

I would feel a lot happier using SQLite if this was a per DB setting rather than a per connection one.

Re:Why you should probably be using SQLite by angra_mainyu on Friday October 27, 2023 @01:58PM (#38041730)
> Not a solid guarantee

How so? Are you saying that sqlite would ignore the connection string?

Re:Why you should probably be using SQLite by progmetaldev on Friday October 27, 2023 @04:41PM (#38043652)
An older version that doesn't support the feature will probably just ignore the addition to the connection string.
Re:Why you should probably be using SQLite by progmetaldev on Friday October 27, 2023 @04:50PM (#38043748)
https://sqlite.org/foreignkeys.html#fk_enable

Judging by the documentation, if you issue a PRAGMA foreign_keys; and no row is returned containing a 0 or 1, then you are using an unsupported version of SQLite, or the library was compiled with foreign key support disabled. I am struggling to find any documentation that states if anything will occur if enabling foreign keys in the connection string, when the version does not support foreign keys.

Re:Why you should probably be using SQLite by graemep on Sunday October 29, 2023 @03:58AM (#38056628)
I mean it is too easy to get wrong through human error or buggy application code.