Added support for including keyspace ends in the ranges #80
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've implemented a concept solution for #78. I think this is the best option, ie least bloat for the maximum robustness. The implementation hasn't been tested and needs more documentation. I'm interested in any feedback.
The PR does the following:
StartsWith
variants for all methods that deal with ranges. Those are what developers should use to get the prefix behavior. The original methods continue work as before by default.Subspace#packRange
to deal withstart
/end
combinations. AddSubspace#packRangeStartsWith
for handling prefixes. Like before, the later is what developers should use for prefix behavior but the original one stays backwards compatible by default.Subspace
, so that there's only one central place for all that complexity. While packing/unpacking individual keys/values doesn't strictly need to go through subspace, there's now less reason to keep the transformer copies around. Maybe it should be a separate commit._noDefaultPrefix
flag to subspace andSubspace#noDefaultPrefix
andDatabase#noDefaultPrefix
methods. These switch the subspace to a mode that enables including key space ends in the ranges. The naming of these could be improved.noDefaultPrefix
mode.