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

Add a feature to load migrations from a directory #51

Merged
merged 1 commit into from
Apr 5, 2023

Conversation

czocher
Copy link
Collaborator

@czocher czocher commented Mar 17, 2023

This PR provides a new feature from-directory which allows to specify a directory used to load migrations from and store them in the binary.
This implementation assumes that the directory contains *.sql files with a documented naming pattern.

Closes #37.

TODO:

@cljoly feel free to have a first look and review.

@czocher czocher force-pushed the from-directory branch 2 times, most recently from fa0576a to efb4764 Compare March 17, 2023 21:27
@czocher czocher changed the title WIP: Add a feature to load migrations from a directory Add a feature to load migrations from a directory Mar 17, 2023
@czocher
Copy link
Collaborator Author

czocher commented Mar 17, 2023

Required PRs were merged, marking TODO as done. Rebased the PR on top of master. It's ready for review.

Copy link
Owner

@cljoly cljoly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ve taken a quick look, looks quite promising!

rusqlite_migration/src/asynch.rs Show resolved Hide resolved
rusqlite_migration/src/loader.rs Outdated Show resolved Hide resolved
rusqlite_migration/src/loader.rs Outdated Show resolved Hide resolved
rusqlite_migration/src/asynch.rs Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Mar 19, 2023

Coverage Status

coverage: 89.404% (-2.0%) from 91.44%
when pulling 7f962b3 on Czocher:from-directory
into be0834c on cljoly:master.

@czocher czocher force-pushed the from-directory branch 9 times, most recently from 88d026f to 2d0470a Compare March 19, 2023 19:04
@cljoly

This comment was marked as resolved.

@czocher czocher force-pushed the from-directory branch 10 times, most recently from 17611eb to 348e92f Compare March 20, 2023 19:46
Copy link
Owner

@cljoly cljoly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the thorough documentation and testing. I’ve posted quite a few comments, but some are for follow-up work. I think we are getting close to being able to merge!

The subdirectory idea is also much simpler, it could pave the way (in a future PR) to dropping the from_directory dependency and to using our own macro, for the sake of runtime efficiency (the readme should be updated then and tradeoff between compile-time and run-time costs explained)

rusqlite_migration/src/lib.rs Outdated Show resolved Hide resolved
rusqlite_migration/src/lib.rs Show resolved Hide resolved
rusqlite_migration/src/lib.rs Outdated Show resolved Hide resolved
rusqlite_migration/src/lib.rs Show resolved Hide resolved
rusqlite_migration/src/builder.rs Outdated Show resolved Hide resolved
examples/from-directory/src/main.rs Outdated Show resolved Hide resolved
rusqlite_migration/src/loader.rs Outdated Show resolved Hide resolved
rusqlite_migration_tests/tests/from_directory_test.rs Outdated Show resolved Hide resolved
rusqlite_migration/src/loader.rs Show resolved Hide resolved
rusqlite_migration/src/loader.rs Show resolved Hide resolved
Copy link
Owner

@cljoly cljoly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@cljoly cljoly merged commit 4283698 into cljoly:master Apr 5, 2023
@cljoly
Copy link
Owner

cljoly commented Apr 5, 2023

Thanks for your contribution!

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.

Load migrations from a directory and store them in the binary
3 participants