FlowKit icon indicating copy to clipboard operation
FlowKit copied to clipboard

Per-query versioning

Open greenape opened this issue 4 years ago • 3 comments

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!

greenape avatar Nov 05 '21 10:11 greenape

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.

greenape avatar Oct 08 '24 10:10 greenape

Will make some of our tests a pain in the ass though, where we're checking for hash consistency or rely on it.

greenape avatar Oct 08 '24 10:10 greenape

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.

greenape avatar Oct 10 '24 10:10 greenape