![]() I realize that the term is very fuzzy and can mean all sorts of things, but, to me, "weakly typed" means that data of one type can be treated as if it were another type, without explicit type conversions. They're not judging you, they're just obeying their designs.) I realize a lot of people can be judgmental about type disciplines, but leave the poor type disciplines. (On the other hand, their use of the word word "judgmental" to describe strong static typing is unambiguously pejorative. And that the distinction describes a real thing about SQLite's behavior that is distinct from, if related to, its dynamic typing. I would personally say that they're accurate, and not necessarily pejorative. We consider these terms to be inaccurate and pejorative. > Some commentators say that SQLite is "weakly typed" and that other SQL databases are "strongly typed". But I personally would rather see it happen as a (perhaps temporary) fork rather than a change to the core engine, so that people who are happy with SQLite's current type discipline don't have to be taken along for the ride. It might be fun to fork it and try implementing a feature like this just to see, though. My guess is that, given the nature of what SQLite is and the kinds of people who use it (IIRC, it was originally developed for military applications), they've also made a decision that mucking with such a core portion of the database's implementation has such a great potential for unseen consequences that it's just not worth the risk.Ī little bit like how, at least according to rumor, Python hasn't done anything about its famous global interpreter lock because, when they looked into it, they found that, while it would be a big performance boost in some areas, it would also cause a large performance degradation for the silent majority of people who aren't writing multithreaded Python code. Some ask, why would you want a database like this? I don't know, perhaps to match your application language if it is also typed dynamically. If the TEXT value is not a well-formed integer or real literal, then the value is stored as TEXT." So NUMERIC is kind of like TEXT except when the text is a pure number. When text data is inserted into a NUMERIC column, the storage class of the text is converted to INTEGER or REAL (in order of preference) if the text is a well-formed integer or real literal. ![]() From the documentation: "A column with NUMERIC affinity may contain values using all five storage classes. My takeaway from that is: (1) for many people, SQLite is not your database, but you already knew that, (2) it is nice there exists a database out there with this flexibility, if you want it, and (3) if you choose it, you might consider declaring columns NUMERIC. ![]() I think you will see that the choice wasn't sloppy but thoughtfully designed, Before rendering judgment, please read SQLite's own page on the subject. ![]()
0 Comments
Leave a Reply. |