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.
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.