Comparing version 2.8.3 to 2.8.4
@@ -57,3 +57,3 @@ import { Compression, getAddress, arch, fs, path as pathModule, lmdbError, EventEmitter, MsgpackrEncoder, Env, | ||
let userOptions = options; | ||
if (!path) { | ||
if (path == null) { | ||
options = Object.assign({ | ||
@@ -74,3 +74,2 @@ deleteOnClose: true, | ||
options = Object.assign({ | ||
path, | ||
noSubdir: Boolean(extension), | ||
@@ -88,2 +87,3 @@ isRoot: true, | ||
}, options); | ||
options.path = path; | ||
if (options.asyncTransactionOrder == 'strict') { | ||
@@ -90,0 +90,0 @@ options.strictAsyncOrder = true; |
{ | ||
"name": "lmdb", | ||
"author": "Kris Zyp", | ||
"version": "2.8.3", | ||
"version": "2.8.4", | ||
"description": "Simple, efficient, scalable, high-performance LMDB interface", | ||
@@ -83,6 +83,5 @@ "license": "MIT", | ||
"node-addon-api": "^6.1.0", | ||
"node-gyp-build-optional-packages": "5.1.0", | ||
"node-gyp-build-optional-packages": "5.1.1", | ||
"ordered-binary": "^1.4.1", | ||
"weak-lru-cache": "^1.2.2", | ||
"yarn": "^1.22.19" | ||
"weak-lru-cache": "^1.2.2" | ||
}, | ||
@@ -110,9 +109,9 @@ "devDependencies": { | ||
"optionalDependencies": { | ||
"@lmdb/lmdb-darwin-arm64": "2.8.3", | ||
"@lmdb/lmdb-darwin-x64": "2.8.3", | ||
"@lmdb/lmdb-linux-arm": "2.8.3", | ||
"@lmdb/lmdb-linux-arm64": "2.8.3", | ||
"@lmdb/lmdb-linux-x64": "2.8.3", | ||
"@lmdb/lmdb-win32-x64": "2.8.3" | ||
"@lmdb/lmdb-darwin-arm64": "2.8.4", | ||
"@lmdb/lmdb-darwin-x64": "2.8.4", | ||
"@lmdb/lmdb-linux-arm": "2.8.4", | ||
"@lmdb/lmdb-linux-arm64": "2.8.4", | ||
"@lmdb/lmdb-linux-x64": "2.8.4", | ||
"@lmdb/lmdb-win32-x64": "2.8.4" | ||
} | ||
} |
31
read.js
@@ -403,2 +403,5 @@ import { RangeIterable } from './util/RangeIterable.js'; | ||
function position(offset) { | ||
if (!env.address) { | ||
throw new Error('Can not iterate on a closed database'); | ||
} | ||
let keySize = currentKey === undefined ? 0 : store.writeKey(currentKey, keyBytes, 0); | ||
@@ -645,15 +648,15 @@ let endAddress; | ||
// if it is root, we need to abort and/or wait for transactions to finish | ||
if (readTxn) { | ||
try { | ||
readTxn.abort(); | ||
} catch(error) {} | ||
} | ||
readTxn = { | ||
renew() { | ||
if (readTxn) readTxn.abort(); | ||
else readTxn = {}; | ||
readTxn.isDone = true; | ||
Object.defineProperty(readTxn,'renew', { | ||
value: () => { | ||
throw new Error('Can not read from a closed database'); | ||
}, | ||
use() { | ||
}, configurable: true | ||
}); | ||
Object.defineProperty(readTxn,'use', { | ||
value: () => { | ||
throw new Error('Can not read from a closed database'); | ||
} | ||
}; | ||
}, configurable: true | ||
}); | ||
readTxnRenewed = null; | ||
@@ -707,2 +710,5 @@ txnPromise = this._endWrites && this._endWrites(); | ||
try { | ||
if (!env.address) { | ||
throw new Error('Can not renew a transaction from a closed database'); | ||
} | ||
let lastReadTxn = lastReadTxnRef && lastReadTxnRef.deref(); | ||
@@ -740,7 +746,6 @@ readTxn = new Txn(env, 0x20000, lastReadTxn && !lastReadTxn.isDone && lastReadTxn); | ||
readTxn = null; | ||
} else if (readTxn.address) { | ||
} else if (readTxn.address && !readTxn.isDone) { | ||
resetTxn(readTxn.address); | ||
} else { | ||
console.warn('Attempt to reset an invalid read txn', readTxn); | ||
readTxn = null; | ||
throw new Error('Attempt to reset an invalid read txn'); | ||
@@ -747,0 +752,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2355674
11
6250
+ Added@lmdb/lmdb-darwin-arm64@2.8.4(transitive)
+ Added@lmdb/lmdb-darwin-x64@2.8.4(transitive)
+ Added@lmdb/lmdb-linux-arm@2.8.4(transitive)
+ Added@lmdb/lmdb-linux-arm64@2.8.4(transitive)
+ Added@lmdb/lmdb-linux-x64@2.8.4(transitive)
+ Added@lmdb/lmdb-win32-x64@2.8.4(transitive)
+ Addednode-gyp-build-optional-packages@5.1.1(transitive)
- Removedyarn@^1.22.19
- Removed@lmdb/lmdb-darwin-arm64@2.8.3(transitive)
- Removed@lmdb/lmdb-darwin-x64@2.8.3(transitive)
- Removed@lmdb/lmdb-linux-arm@2.8.3(transitive)
- Removed@lmdb/lmdb-linux-arm64@2.8.3(transitive)
- Removed@lmdb/lmdb-linux-x64@2.8.3(transitive)
- Removed@lmdb/lmdb-win32-x64@2.8.3(transitive)
- Removednode-gyp-build-optional-packages@5.1.0(transitive)
- Removedyarn@1.22.22(transitive)