Level / community

Discussion, support and common information for projects in the community.
MIT License
42 stars 15 forks source link

Add options to approximateSize & compactRange #85

Closed vweevers closed 2 years ago

vweevers commented 4 years ago

If you do:

const db = require('level')('db') // or similar
db.approximateSize('a', 'b', { valueEncoding: 'json' }, callback)

Then encoding-down correctly encodes the start (a) and end (b) arguments as JSON, but it also passes the options argument down to leveldown, which doesn't support that: it expects a callback at that index.

Add options to approximateSize() and compactRange() in:

vweevers commented 4 years ago

Similarly, iterator.seek() and chained batch operations (Level/levelup#633) don't support encoding options. In general, all methods should start following the basic signature fn(..., options, callback).

vweevers commented 2 years ago

Done in classic-level (not on npm yet), including for seek(). I will also add it to rocks-level, the yet-to-be-written replacement for rocksdb. These fixes will not be backported to leveldown or rocksdb.