Does anyone remember if Clojure patches given out at any of the Conjs?
I don’t remember where/when I got this, but I can’t think of a more likely place than a Conj
Ah yes! I remember that now! I may still have it! 🤞
I did attend a Clojure/West (don’t remember the year), so it could have been there, too.
https://sqlite.org/flextypegood.html#about_flexible_typing TIL types are effectively optional for sqlite columns - and a lot of the rationale given seems familiar: > Flexible typing is a natural fit for use with dynamic programming languages like TCL and others, since with a dynamic programming language, you can not always predict in advance what datatype a variable will hold. So when you need to store the value of that variable into the database, having a database that supports flexible typing makes storage much easier. > Some people contend that if you have rigorous constraints on the schema, and especially strict enforcement of column datatypes, this will help prevent incorrect data from being added to the database. This is not true. It is true that type enforcement might help prevent egregiously incorrect data from getting into the system. But type enforcement is no help in prevent subtly incorrect data from being recorded. > Data errors are inevitable. They will happen regardless of how much type checking is done. Rigid type enforcement can catch only a small subset of those cases - the most obvious cases. It does nothing to help find and fix the more subtle cases. And, by suppressing the signal of which data sources are problematic, it can sometimes make the subtle errors more difficult to locate.
> As of SQLite version 3.37.0 (2021-11-27), SQLite supports this development style using https://sqlite.org/stricttables.html. > If you find a real-world case where STRICT tables prevented or would have prevented a bug in an application, please post a message to the https://sqlite.org/forum/forum so that we can add your story to this document. > (Update 2026-07-12): After nearly 5 years, nobody has yet shown me a single case where rigid type enforcement prevented an application bug. I have read many strident and emotional appeals in support of rigid type enforcement, but have seen no actual examples or real-world data. I have been confronted with a lot of doctrine, but no actual evidence. heard it all before!
A hard-core type proponent would simply retort with “if your types don’t prevent some errors, they are not strict/advanced enough”. :) And since you mentioned “TIL” - just in case, so you don’t get bitten by it later: SQLite is kinda a compromise in types, and I think not a good one. Very JavaScript’ey for my tastes. It doesn’t have column types, it has affinities. So basically “this column says it prefers type X, the data is of type Y, and if I can convert Y to X then it will be stored as X, otherwise it will be stored as Y”. And the rules to determine the affinity of a column aren’t that straightforward. Plenty of bad things can happen that way. At the very least, precision loss. The fact that nothing got reported can mean one of: 1. Incredible luck has been doled out 2. Nobody unlucky cared to report, or even knew of the possibility 3. The bugs exist but haven’t been detected (very, very easy not to notice precision loss)
And actually, I can see myself reporting a case for where STRICT prevented a proper bug, only if a few things were different:
1. The things in question that required high precision were happening during the past 5 years and not 10 years ago
2. SQLite was used instead of CSV and custom data readers
We had so many problems with scientific data showing 0 instead of something like 1e-350… And then in the articles: “We filtered out zero values because those were outliers or glitches”. All while values like 1e-350 were actually the strongest signal, and the scientists working with the data simply had no clue how floating point values work in programs in general.
I the topic of sqlite even though it has jsonb type. I’m a big fan of shredding/sparse tables for json and CSV. https://github.com/andersmurphy/hyperlith/blob/e254117c402b8f4642ccbda930fb964a2ec06fd3/src/hyperlith/impl/sqlite.clj#L335 It’s really nice when you’re dealing with a bunch of open/messy format bank feeds from different providers.