kriszyp / lmdb-js

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

Using noSubdir option results in "Is a directory" error #15

Closed hjerabek closed 3 years ago

hjerabek commented 3 years ago

Using Node 12.18.3, I tried creating an lmdb-store with the noSubdir option. Instead of a single lmdb file, a directory gets created and an "Is a directory" error (code 21) is thrown. The following snippet should allow to reproduce the problem:

var db=require("lmdb-store").open({
    path:"mydata",
    maxDbs:1,
    noSubdir:true
});
console.log(db.get("foo"));
console.log(db.putSync("foo","bar @ "+Date.now()));
console.log(db.get("foo"));

PS: The respective option works as expected when using node-lmdb itself.

kriszyp commented 3 years ago

Should be fixed in 0.8.3, thanks for reporting.

hjerabek commented 3 years ago

Thanks for the quick fix.

kriszyp commented 3 years ago

I actually noticed another related issue with noSubdir being unable to create a new file on non-Windows OS that should be fixed with 0.8.4.