Closed omh closed 5 years ago
@omh Hey! Thanks for the suggestion. I think this could be resolved by adding @external_resource <filename>
module attribute inside the defqueries
macro.
Yes, you're right! I did not know about @external_resource
, thanks! Could have saved me from a fair bit of work :) Oh well, learned a lot anyways! I'll see if I can make a PR to tweak the documentation a bit.
Still, I'm going to add this as an built-in enhancement for defqueries/1
, so I'll reopen this to keep it in the backlog.
Cool. Made a small PR that uses @external_resource
-> #3
This feature is supported now :)
Hi,
Currently, if you change the .sql file the query module that refers to via
defqueries
, it isn't recompiled. This means new queries are unavailable until the Query module is recompiled. Which means making an arbitrary change to it even though nothing has changed.I got a prototype working with a Mix compiler that checks MD5 of the .sql and touches the Query module if it changed. This triggers a recompile. Would a pull request for that be of interest?
To achieve it I had to change the API a tad:
From:
To:
It's a breaking change, but it's very easy to update. Let me know what you think.