replikativ / konserve

A clojuresque key-value/document store protocol with core.async.
Eclipse Public License 1.0
299 stars 25 forks source link

Add protocol for iterating keys in a store #29

Closed csm closed 4 years ago

csm commented 4 years ago

Introduces a new protocol PKeyIterable, which defines the method -keys that returns a channel yielding all toplevel keys in the store, in sorted order. Adds implementations of this for memory and filestore.

This adds a function konserve.core/keys, which might not be the best name since it overrides clojure.core/keys. Alternate name suggestions are welcomed.

csm commented 4 years ago

I was trying to think of ways to do node GC in hitchhiker-tree, and at least some way to iterate keys in the store is a starting point. There might be other approaches, and the keys output might not need to be sorted.