Open thizanne opened 6 years ago
The (auto_)check functions work by creating a database with the schema declared with sqlinit
, and then prepare all statements against it. This catches all the errors Sqlite itself would detect (mismatching columns, wrong joins, plain SQL syntax errors...). The problem is that Sqlite uses dynamic typing and is much more lenient that I'd like (it only uses the types as a default "affinity" and then performs conversions automatically), so it doesn't complain when there's a type mismatch and instead performs dynamic conversions.
Not sure if it's possible with the model of sqlexpr, but it would be nice in if the following code, the
should_fail
SQL queries were detected byauto_check_db
.I'm guessing this is far more difficult than checking field names with prepared statements, but I am no expert in Sqlite so I'm still asking.