cberner / redb

An embedded key-value database in pure Rust
https://www.redb.org
Apache License 2.0
3.22k stars 147 forks source link

RFC: Add wrapper type to handle keys and values based on bincode serialization #805

Closed adamreichold closed 3 months ago

adamreichold commented 5 months ago

The first commit is just to make current Clippy build cleanly and can be drop if so desired.

Not sure if you want such additions as this could be considered "playing favourites" with a particular format and you might see requests to add many others. OTOH, Bincode is a pretty decent default for binary serialization formats of small messages.

cberner commented 5 months ago

Hmm, ya I'm not sure I want to add this. My philosophy has been to leave out extra features which users can easily implement on their own, but I'll give it some more thought. If you want to send that first Clippy commit has a separate PR I'd be happy to merge that

adamreichold commented 5 months ago

Hmm, ya I'm not sure I want to add this. My philosophy has been to leave out extra features which users can easily implement on their own, but I'll give it some more thought.

Maybe as one argument to why this could be useful upstream: While the code can easily be implemented downstream, there is also basically one way to write it and hence every downstream project will contain a copy of this same code creating quite a bit of unnecessary busy work. So I think shipping something like this could be good community service and make the project more approachable.

If you want to send that first Clippy commit has a separate PR I'd be happy to merge that

This is #807

cberner commented 3 months ago

Sorry it took me a while to reply here. I thought about this some more and decided not to merge it now. If you'd like to submit it as a PR in the examples/ directory I'd be happy to put it there, and then people can copy if they want

adamreichold commented 3 months ago

Understood. Will rework this into an example.

adamreichold commented 3 months ago

Reworked into an example based on the existing int_keys one.

cberner commented 3 months ago

Merged, thanks!