kriszyp / lmdb-js

Simple, efficient, ultra-fast, scalable data store wrapper for LMDB
Other
481 stars 39 forks source link

clearAsync fails when key-encoding = 'binary' and encryption #199

Open leiffoged opened 1 year ago

leiffoged commented 1 year ago

clearAsync seems to not work for DBs with key-encoding = 'binary'

Repro: 1/ Create a new DB. Settings: {keyEncoding: 'binary'}

2/ Call clearAsync TypeError: Cannot convert undefined or null to object at Buffer.set () at LMDBStore.writeBufferKey [as writeKey] (/Users/leif/code/node-modules/lmdb/dist/index.cjs:1258:9) at writeInstructions (/Users/leif/code/node-modules/lmdb/dist/index.cjs:284:25) at LMDBStore.clearAsync (/Users/leif/code/node-modules/lmdb/dist/index.cjs:838:11)

Does not fail with keyEncoding = 'ordered-binary'

kriszyp commented 1 year ago

Fix should be available in v2.6.9.

leiffoged commented 1 year ago

Woo!! Thank you!