Per-query versioning
At present, if you cache a query, then the SQL only for that query changes in a subsequent release, you may get an incorrect result unless you clear the cache first, because generated SQL is not included in the id hash. An obvious solution would be to add a version field per query, although this relies on people remembering to bump the version!
Reflecting on this after getting bitten by a cache version mismatch, I think maybe better to just include the version of fm in the hash. Less error prone at the expense of being more wasteful, but I think that's an acceptable tradeoff.
Will make some of our tests a pain in the ass though, where we're checking for hash consistency or rely on it.
Maybe one option here would be to append the version to the hash unhashed? That way one could split it out in tests.. You'd need to change the separator to make it a valid table name, or change the table name to not be strictly the same as x<query_id> I guess.