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

How to set options on Storage creation? #4

Open
glebpom opened this issue Mar 27, 2021 · 3 comments
Open

How to set options on Storage creation? #4

glebpom opened this issue Mar 27, 2021 · 3 comments

Comments

@glebpom
Copy link
Contributor

glebpom commented Mar 27, 2021

I'd like to initialize ledb with no_lock lmdb option, because I'm maintaining locks in my code. Is there an option to set this flag in Options struct? Thanks

@katyo
Copy link
Owner

katyo commented Mar 27, 2021

Seems fields of options is private:
https://docs.rs/ledb/0.4.0/src/ledb/storage.rs.html#99-128

It because I planned to turn Options to builder but I don't sure how it may be implemented more usably.
You can fix that and open PR.

As alternative you can use serde-way (something like json macro) to set corresponding options (see code above).

@glebpom
Copy link
Contributor Author

glebpom commented Mar 27, 2021

There are crates like https://crates.io/crates/derive_builder to create builders easily. For sure, I can create PR. What do you think about adding the dependency?

@katyo
Copy link
Owner

katyo commented Mar 27, 2021

The compile-time dependencies is not so terrible for me, so you absolutely free to add any of it without hesitation while it is maintained and does not break compilation.

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