4 ms·
Is there a switch somewhere to turn reasonable behavior on?
by mike_hock 5y ago
Is there a switch somewhere to turn reasonable behavior on?
- capableweb 5y agoWhat does "reasonable" mean here? Clearly, for SQLite, it is reasonable because that's how they want their database to work. But for someone who is used to MongoDB, maybe "reasonable" means that you can store documents instead. Actually, your comment almost strikes me as mean. Instead of asking "can I make it not dynamically typed?", you're asking for "reasonable" behavior, implying the existing behavior is not reasonable, basically spitting on the SQLite projects decision.
- vbezhenar 5y agoMost RDBMSs use static typing. That's what people expect from a database. It is SQL database, so people naturally expect familiar concepts to behave consistently with their previous experience. If database fails that assumption, it's fair to call this behaviour unreasonable. It's understandable that this was early design error which is impossible to correct now, but calling it reasonable just not to hurt someones feelings is unreasonable.
- em500 5y agoThink of SQLite not as a replacement for Oracle but as a replacement for fopen().
- capableweb 5y agoMost databases also allows you to remotely connect to them, does that mean that SQLite not offering that is unreasonable? No, it means that your understanding of SQLite is incorrect, as the use case for SQLite is not to offer remote connections. Same goes for dynamically/statically typed. Your comment about this being a "design error" is also in bad taste. Have you tried looking up where this decision comes from and why it is like that? According to the SQLite folks, this is on purpose, not by accident. > As far as we can tell, the SQL language specification allows the use of manifest typing. Nevertheless, most other SQL database engines are statically typed and so some people feel that the use of manifest typing is a bug in SQLite. But the authors of SQLite feel very strongly that this is a feature. The use of manifest typing in SQLite is a deliberate design decision which has proven in practice to make SQLite more reliable and easier to use, especially when used in combination with dynamically typed programming languages such as Tcl and Python. https://www.sqlite.org/different.html https://www.sqlite.org/different.html
- vbezhenar 5y agoHere's quote: "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." For me it means that SQLite developers admit it was a mistake and should have been implemented differently. I don't understand why this mistake can't be corrected now, with some opt-in "strict types" pragma, but whatever.
- CRConrad 5y agoYour getting your panties in a bunch like this over some rather innocuous word choices would be understandable, albeit perhaps somewhat exaggerated, if you are one of the creators of SQLite. If you aren't, it's definitely exaggerated and not... Reasonable.
- goto11 5y ago> basically spitting on the SQLite projects decision. That is a very emotional response given the SQLite FAQ itself basically admit the design is unfortunate. They just state it is too late to change due to backwards compatibility. So it is not crazy to suggest an opt-in flag to change the default behavior, although I can understand if the SQLite team does not bother.
- capableweb 5y agoMaybe the different authors of the website disagrees with each other then, as this paragraph from the website seems to disagree with your statement: > Nevertheless, most other SQL database engines are statically typed and so some people feel that the use of manifest typing is a bug in SQLite. But the authors of SQLite feel very strongly that this is a feature. The use of manifest typing in SQLite is a deliberate design decision which has proven in practice to make SQLite more reliable and easier to use https://www.sqlite.org/different.html https://www.sqlite.org/different.html
- goto11 5y agoTo be clear the FAQ only states it might have been a mistake to make flexible typing the default everywhere, not that support for flexible typing in itself is a bad idea. But I don't think anyone is against support for flexible typing as an opt-in feature.