Open FiV0 opened 1 year ago
I read up some more on fdb and the thing I was missing were KeySelector
's. Your get-range
currently does not support those. I will try to add those and also look into adding the limit option mentioned in #28.
Would you also be interested in a PR with a version for get-range
that preserves the order of the keys, because that is essentially my use case. Could be a new function or with some option for get-range that instead of accumulating into a map, accumulates into a sequential structure.
I'd happily review a PR which adds supports for KeySelectors and limit / skip / cursors to get-range
(Make it multiple PRs for easy review)
Re: returning keys in order, that is the default behaviour of FDB if I understand correctly, and so it should be happening already. (sorted by byte representation / packing)
ReRe: returning keys in order.
You currently accumulating the result of ftr/get-range
into a map here https://github.com/vedang/clj_fdb/blob/master/src/me/vedang/clj_fdb/core.clj#L152-L157 that essentially mangles the order returned by ftr/get-range
.
Oops, sorry. I replied without looking at the code.
Yes, I don't mind a new function which returns tuples in the correct order, instead of returning a key->value map.
Thinking out loud about how to return the range in the correct order:
fc/get-range
controlled by default-opts
passed into the function. This will let the user decide whether they want a map back or a vector of [k, v] tuples, and the meaning would be self-explanatory flatland/ordered-map
to ensure that the map is ordered correctly.Let me think through the preferred implementation. Happy to hear your thoughts as well.
Hey, thanks for the library.
I am trying to use it with raw byte buffers (well for reasons...). The following piece of code illustrates the issue
So essentially I am struggling how to query for all values that satisfy a certain raw prefix in a subspace. Is this possible with your wrapper? I tried all kinds of variations for
get-range
but it never returned anything useful.