5 ms·
> SQLite doesn't really enforce column types[0], the choice is really puzzling to me. This is acknowledged as a likely mistake, but one that will never be fixe
by haberman 6y ago
> SQLite doesn't really enforce column types[0], the choice is really puzzling to me.
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 https://sqlite.org/quirks.html
- doomleika 6y agoYeah, 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.
- mastre_ 6y ago> 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.).
- isoprophlex 6y agoConsidering that we're on sqlite3 already, it'd probably be something for the v4 ;)
- deleted 6y ago[deleted]
- warmwaffles 6y agoThere is already an sqlite4 but they haven't done any work with it for a long time.
- mbreese 6y agoThis 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.
- deleted 6y ago[deleted]
- setr 6y agoSQLite 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
- pdimitar 6y agoSomething 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.
- dfox 6y agoI 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.
- mikedilger 6y agoMaybe there could be a fork called SQLITE, an acronym for SQLite Including Type Enforcement
- trissylegs 6y agoI think that would win the prize for most ungooglable name. (As Google is not very cases sensitive)