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

Allow compaction from lib #38

Open
rubend056 opened this issue May 3, 2024 · 2 comments
Open

Allow compaction from lib #38

rubend056 opened this issue May 3, 2024 · 2 comments

Comments

@rubend056
Copy link

Is there any way the compaction interface can be reformatted so its exported from lib.

This is extremely useful as it allows compaction to be done at regular intervals from a downstream crate executable, instead of having to manually run the sonnerie command line tool.

I will try to give it a go on a pull request, but I remember looking at it before and it not being trivial.

@njaard
Copy link
Owner

njaard commented May 3, 2024

Hi @rubend056 , in fact the only code you really need is to read and write the database again, https://github.com/njaard/sonnerie/blob/master/src/main.rs#L490 and then the _purge_compacted_files

It's not part of the API because I just didn't know what it would look like.

@rubend056
Copy link
Author

Sorry for the delayed response, I'll make a commit to my fork and a pull request today :) let me know of any issues you can spot.

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

No branches or pull requests

2 participants