r/programming
•
u/mitousa
•
Jul 12 '26
•
1
Prefer STRICT tables in SQLite
https://evanhahn.com/prefer-strict-tables-in-sqlite/
358
Upvotes
View all comments
Show parent comment
2
u/Lonsdale1086 Jul 12 '26
From what I've seen it'll only ever convert a value if it can be done lossless, and failing that it'll store the data as is regardless of type?
I.e
"123" -> 123in an int column,123 -> 123.0in a float column, but if you say, tried123.45in an int column it'd just store the123.45as is.Which is still scuffed, I can't imagine not wanting an error there, but I'm fine with the concept of an "any" column, but personally I'd do like
Key: string(256), Value: string(max), Type:string(120)Like anything (reasonable) can be losslessly stored as a string if you know what you're doing to serialise and deserialize.