Open dbkaplun opened 6 years ago
similar to how a merge operator can be provided, it would be nice to support a custom prefix extractor / comparator
do you have a specific use case in mind for this?
Nope, just looking into some database designs and noticed that RocksDB supports custom ordering, which seems useful.
@spacejam I am really missing this feature. I am using bincode to serialize my keys which are slices (of things which aren't u8), but bincode will write the length first, changing the order. So i have have to serialize each item in the slice and then concat them to get the correct sorting behaviour.
Also it would be nice if someone could write a wrapper that does the binary serialization internally so that functions like this are exposed get(key: K) -> Option<V> where K&V: Ord + Serializable
It would be great if custom ordering was allowed for non-lexicographic datasets, perhaps allowing a fallback to default ordering.
Thanks for considering!