Tell HN: Cast('abc' AS INTEGER) returns 0 in SQLite
Every day I encounter more weirdness of SQLite. Is this the JavaScript of databases?
3 threads
There is more: https://dbfiddle.uk/FDkqamR_
(Some examples there no longer work with the current version - so they are improving :) )
This is by design and well documented though.
It's so lite, it even removes the errors
What do you want it to return? You should really RTFM of SQLite. It's by design.
It is not a good design. It should throw an error.
Then declare your table(s) as strict; that should solve your issues.
But strict isn't supported if you are using exotic data types like DATE or TIMESTAMP
Even with STRICT, explicit CAST() has the same problem.