kvdb: add ForAll

A new method to allow efficient range queries for backends that support
it.
This commit is contained in:
Joost Jager committed 2022-01-12 19:11:53 +01:00
1 parent 102a1cbaaa
commit b8408a1484
7 files changed
+114 -3

No files matched your search

+6
View File
@@ -406,3 +406,9 @@ func (b *readWriteBucket) Prefetch(paths ...[]string) {
b.tx.stm.Prefetch(flattenMap(keys), flattenMap(ranges))
}
// ForAll is an optimized version of ForEach with the limitation that no
// additional queries can be executed within the callback.
func (b *readWriteBucket) ForAll(cb func(k, v []byte) error) error {
return b.ForEach(cb)
}