Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refrain from re-initializing query-fn if queries files not modified #122

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

gerdint
Copy link
Contributor

@gerdint gerdint commented Dec 14, 2023

Perhaps this is overkill, but since a lot of your components will probably depend on the :db.sql/query-fn component the fact that it was not resumable caused pretty much all components to be reloaded when doing (reset).

This PR adds an explicit check if any of the hugsql queries files are modified, and if not the old implementation is returned upon resume.

Requires Java 7+ since java.nio.file APIs are used for getting the modification time. (java.io.File#lastModified unfortunately always seem to return 0, at least on macOS).

@yogthos yogthos merged commit 7c8ebdb into kit-clj:master Dec 14, 2023
1 check passed
@yogthos
Copy link
Collaborator

yogthos commented Dec 14, 2023

I think this is a good idea, it's a nice quality of life improvement for the development experience. 👍

@gerdint
Copy link
Contributor Author

gerdint commented Dec 14, 2023

Cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants