Assert SQL statements are correct
We had a few bugs because of broken SQL queries. In order to find these we should encapsulate all the sqlite-function calls in a macro which performs checking of the return value and crashes (*) dt if something goes wrong. That might be annoying, but it enables us to find bugs fast.
(*) or print a warning.