SQLite already has different operating modes, right? e.g. WAL is turned on and stays on, I think; It seems like you could at least make type-checking an opt-in mode
WAL is journaling mode set on the connection. It’s not a db level setting.
WAL mode will stick after subsequent "connections".
Something like "PRAGMA STRICT = ON;" should be trivial to add after the strict mode is actually implemented.
But IMO that would just warrant an entirely separate software package. Shoving it inside sqlite3 is likely to make it much more complex.
Re:SQLite is not a toy database
by mikedilger on Friday March 26, 2021 @01:24AM
(#26588992)
Maybe there could be a fork called SQLITE, an acronym for SQLite Including Type Enforcement
Re:SQLite is not a toy database
by trissylegs on Friday March 26, 2021 @02:40AM
(#26589375)
I think that would win the prize for most ungooglable name. (As Google is not very cases sensitive)
Yeah, still I would really wish SQLite is a feather weight RDBM system than almost-but-not-quite-your-typical-RDBMS the better `fopen`.
Having a tool like this would made my life whole lot easier, well, one can dream.
I would not say that it is acknowledged as a mistake. Sqlite originally comes from Tcl world and thus it is somewhat natural that it follows Tcl's stringly-typed object model.
> but one that will never be fixed due to backward compatibility
I wonder if a fork/"new version" could address this. Like, sqlite2 (v1.0, etc.).
Re:SQLite is not a toy database
by isoprophlex on Thursday March 25, 2021 @02:43PM
(#26583827)
Considering that we're on sqlite3 already, it'd probably be something for the v4 ;)
Re:SQLite is not a toy database
by warmwaffles on Thursday March 25, 2021 @11:44PM
(#26588547)
There is already an sqlite4 but they haven't done any work with it for a long time.
This would be something on the order of the python2 -> python3 transition. Meaning, it would likely take a decade. After going though that, I'm not sure it would be worth it to just change from (default) flexible data types.
This is acknowledged as a likely mistake, but one that will never be fixed due to backward compatibility:
> Flexible typing is considered a feature of SQLite, not a bug. Nevertheless, we recognize that this feature does sometimes cause confusion and pain for developers who are acustomed to working with other databases that are more judgmental with regard to data types. In retrospect, perhaps it would have been better if SQLite had merely implemented an ANY datatype so that developers could explicitly state when they wanted to use flexible typing, rather than making flexible typing the default. But that is not something that can be changed now without breaking the millions of applications and trillions of database files that already use SQLite's flexible typing feature.
https://sqlite.org/quirks.html