Back to front pageView on Hacker News (opens in a new tab)Tell HN: Cast('abc' AS INTEGER) returns 0 in SQLite3 pointsby prmph (on Hacker News)12 days agoEvery day I encounter more weirdness of SQLite. Is this the JavaScript of databases?Comments (7) 5 threadsShow all commentsShowing thread 5 of 5[-]vconnor12 days ago1 reply#What do you want it to return? You should really RTFM of SQLite. It's by design.[-]prmph12 days ago1 reply#It is not a good design. It should throw an error.[-]stefanos8212 days ago2 replies#Then declare your table(s) as strict; that should solve your issues.https://sqlite.org/stricttables.htmlprmph12 days ago#Even with STRICT, explicit CAST() has the same problem.hans_castorp12 days ago#But strict isn't supported if you are using exotic data types like DATE or TIMESTAMP
vconnor12 days ago1 reply#What do you want it to return? You should really RTFM of SQLite. It's by design.
stefanos8212 days ago2 replies#Then declare your table(s) as strict; that should solve your issues.https://sqlite.org/stricttables.html
hans_castorp12 days ago#But strict isn't supported if you are using exotic data types like DATE or TIMESTAMP
Comments (7) 5 threads
Show all comments
Showing thread 5 of 5
https://sqlite.org/stricttables.html