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 to kvdb-rocksdb create_if_missing config option #576

Merged
merged 4 commits into from
Aug 4, 2021

Conversation

debris
Copy link
Contributor

@debris debris commented Aug 4, 2021

will be used to implement "auto backend" paritytech/substrate#9201

changes:

  • add to kvdb-rocksdb create_if_missing config option
  • add #[non_exhaustive] above the DatabaseConfig

@debris debris requested review from ordian and arkpar August 4, 2021 13:52
@debris debris requested a review from cheme August 4, 2021 14:13
Copy link
Member

@ordian ordian left a comment

Choose a reason for hiding this comment

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

Could you also put #[non_exhaustive] above DatabaseConfig and update the changelog?
https://rust-lang.github.io/rfcs/2008-non-exhaustive.html#structs-1

@debris
Copy link
Contributor Author

debris commented Aug 4, 2021

Could you also put #[non_exhaustive] above DatabaseConfig and update the changelog?
https://rust-lang.github.io/rfcs/2008-non-exhaustive.html#structs-1

Thanks for the link @ordian I didn't know about this. However this will prevent downstream users from constructing or exhaustively matching the struct. Is it the intended behaviour?

@ordian
Copy link
Member

ordian commented Aug 4, 2021

Could you also put #[non_exhaustive] above DatabaseConfig and update the changelog?
https://rust-lang.github.io/rfcs/2008-non-exhaustive.html#structs-1

Thanks for the link @ordian I didn't know about this. However this will prevent downstream users from constructing or exhaustively matching the struct. Is it the intended behaviour?

They can construct it with

let mut config = DatabaseConfig::default();
config.create_if_missing = false;

and exhaustive matching is disallowed. The intention is to allow adding more fields w/o making a breaking change.

@ordian ordian merged commit 8a1739a into master Aug 4, 2021
@ordian ordian deleted the mk-kvdb-create-if-missing branch August 4, 2021 15:20
@ordian
Copy link
Member

ordian commented Aug 4, 2021

Published

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

Successfully merging this pull request may close these issues.

4 participants