Socket
Socket
Sign inDemoInstall

lmdb

Package Overview
Dependencies
Maintainers
3
Versions
174
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lmdb - npm Package Compare versions

Comparing version 2.9.3-beta.6-debug to 2.9.3

30

caching.js

@@ -26,3 +26,3 @@ import { WeakLRUCache, clearKeptObjects } from './native.js';

let entry = mapGet.call(cache, meta.key);
if (entry && !entry.txnId) {
if (entry) {
entry.txnId = txnId;

@@ -131,19 +131,15 @@ cache.used(entry, expirationPriority + 4); // this will enter it into the LRFU (with a little lower priority than a read)

let entry;
if (this.cachePuts === false) { // we are not caching puts, clear the entry at least
this.cache.delete(id);
} else {
if (result?.isSync) {
// sync operation, immediately add to cache
if (result.result) // if it succeeds
entry = this.cache.setValue(id, value, 0);
else {
this.cache.delete(id);
return result;
} // sync failure
// otherwise keep it pinned in memory until it is committed
} else entry = this.cache.setValue(id, value, -1);
}
if (result?.isSync) {
// sync operation, immediately add to cache
if (result.result) // if it succeeds
entry = this.cache.setValue(id, value, 0);
else {
this.cache.delete(id);
return result;
} // sync failure
// otherwise keep it pinned in memory until it is committed
} else entry = this.cache.setValue(id, value, -1);
if (childTxnChanges)
childTxnChanges.add(id);
if (version !== undefined && entry)
if (version !== undefined)
entry.version = typeof version === 'object' ? version.version : version;

@@ -157,3 +153,3 @@ }

// sync operation, immediately add to cache, otherwise keep it pinned in memory until it is committed
if (value && this.cachePuts !== false && typeof value === 'object' && result) {
if (value && typeof value === 'object' || !result) {
let entry = this.cache.setValue(id, value);

@@ -160,0 +156,0 @@ if (childTxnChanges)

@@ -252,3 +252,3 @@ import { Compression, getAddress, arch, fs, path as pathModule, lmdbError, EventEmitter, MsgpackrEncoder, Env,

assignConstrainedProperties(['copyBuffers', 'getStructures', 'saveStructures', 'useFloat32', 'useRecords', 'structuredClone', 'variableMapSize', 'useTimestamp32', 'largeBigIntToFloat', 'encodeUndefinedAsNil', 'int64AsNumber', 'onInvalidDate', 'mapsAsObjects', 'useTag259ForMaps', 'pack', 'maxSharedStructures', 'shouldShareStructure', 'randomAccessStructure', 'freezeData'],
this.sharedStructuresKey ? this.setupSharedStructures() : {
this.sharedStructuresKey !== undefined ? this.setupSharedStructures() : {
copyBuffers: true, // need to copy any embedded buffers that are found since we use unsafe buffers

@@ -255,0 +255,0 @@ }, options, dbOptions), this.encoder));

{
"name": "lmdb",
"author": "Kris Zyp",
"version": "2.9.3-beta.6-debug",
"version": "2.9.3",
"description": "Simple, efficient, scalable, high-performance LMDB interface",

@@ -65,9 +65,9 @@ "license": "MIT",

"before-publish": "rollup -c && cpy index.d.ts . --rename=index.d.cts && prebuildify-ci download && node util/set-optional-deps.cjs && npm run test",
"prebuild-libc-musl": "ENABLE_V8_FUNCTIONS=false prebuildify-platform-packages --debug --tag-libc --napi --platform-packages --target 18.17.1",
"prebuild-libc": "prebuildify-platform-packages --debug --tag-libc --target 20.0.0 || true && prebuildify-platform-packages --debug --platform-packages --tag-libc --target 18.17.1 && ENABLE_V8_FUNCTIONS=false prebuildify-platform-packages --debug --napi --platform-packages --tag-libc --target 18.17.1",
"prebuild-macos": "prebuildify-platform-packages --debug --target 20.0.0 && prebuildify-platform-packages --debug --platform-packages --target 18.17.1 && ENABLE_V8_FUNCTIONS=false prebuildify-platform-packages --debug --napi --platform-packages --target 18.17.1",
"prebuild-win32": "prebuildify-platform-packages --debug --target 20.0.0 && prebuildify-platform-packages --debug --target 18.17.1 && set ENABLE_V8_FUNCTIONS=false&& prebuildify-platform-packages --debug --napi --platform-packages --target 18.17.1",
"prebuild-libc-arm7": "ENABLE_V8_FUNCTIONS=false prebuildify-platform-packages --debug --napi --platform-packages --tag-libc --target 18.17.1",
"prebuildify": "prebuildify-platform-packages --debug --napi --target 18.17.1",
"full-publish": "cd prebuilds/win32-x64 && npm publish --tag next --access public && cd ../darwin-x64 && npm publish --tag next --access public && cd ../darwin-arm64 && npm publish --tag next --access public && cd ../linux-x64 && npm publish --tag next --access public && cd ../linux-arm64 && npm publish --tag next --access public && cd ../linux-arm && npm publish --tag next --access public && cd ../.. && npm publish --tag next",
"prebuild-libc-musl": "ENABLE_V8_FUNCTIONS=false prebuildify-platform-packages --tag-libc --napi --platform-packages --target 18.17.1",
"prebuild-libc": "prebuildify-platform-packages --tag-libc --target 20.0.0 || true && prebuildify-platform-packages --platform-packages --tag-libc --target 18.17.1 && ENABLE_V8_FUNCTIONS=false prebuildify-platform-packages --napi --platform-packages --tag-libc --target 18.17.1",
"prebuild-macos": "prebuildify-platform-packages --target 20.0.0 && prebuildify-platform-packages --platform-packages --target 18.17.1 && ENABLE_V8_FUNCTIONS=false prebuildify-platform-packages --napi --platform-packages --target 18.17.1",
"prebuild-win32": "prebuildify-platform-packages --target 20.0.0 && prebuildify-platform-packages --target 18.17.1 && set ENABLE_V8_FUNCTIONS=false&& prebuildify-platform-packages --napi --platform-packages --target 18.17.1",
"prebuild-libc-arm7": "ENABLE_V8_FUNCTIONS=false prebuildify-platform-packages --napi --platform-packages --tag-libc --target 18.17.1",
"prebuildify": "prebuildify-platform-packages --napi --target 18.17.1",
"full-publish": "cd prebuilds/win32-x64 && npm publish --access public && cd ../darwin-x64 && npm publish --access public && cd ../darwin-arm64 && npm publish --access public && cd ../linux-x64 && npm publish --access public && cd ../linux-arm64 && npm publish --access public && cd ../linux-arm && npm publish --access public && cd ../.. && npm publish",
"recompile": "node-gyp clean && node-gyp configure && node-gyp build",

@@ -114,9 +114,9 @@ "test": "mocha test/**.test.js --expose-gc --recursive",

"optionalDependencies": {
"@lmdb/lmdb-darwin-arm64": "2.9.3-beta.5-debug",
"@lmdb/lmdb-darwin-x64": "2.9.3-beta.5-debug",
"@lmdb/lmdb-linux-arm": "2.9.3-beta.5-debug",
"@lmdb/lmdb-linux-arm64": "2.9.3-beta.5-debug",
"@lmdb/lmdb-linux-x64": "2.9.3-beta.5-debug",
"@lmdb/lmdb-win32-x64": "2.9.3-beta.5-debug"
"@lmdb/lmdb-darwin-arm64": "2.9.3",
"@lmdb/lmdb-darwin-x64": "2.9.3",
"@lmdb/lmdb-linux-arm": "2.9.3",
"@lmdb/lmdb-linux-arm64": "2.9.3",
"@lmdb/lmdb-linux-x64": "2.9.3",
"@lmdb/lmdb-win32-x64": "2.9.3"
}
}

@@ -97,5 +97,2 @@ import { RangeIterable } from './util/RangeIterable.js';

outstandingReads++;
if (!txn.address) {
throw new Error('Invalid transaction, it has no address');
}
let address = recordReadInstruction(txn.address, this.db.dbi, id, this.writeKey, maxKeySize, ( rc, bufferId, offset, size ) => {

@@ -163,3 +160,2 @@ if (rc && rc !== 1)

buffer.txn = txn;
txn.refCount = (txn.refCount || 0) + 1;

@@ -411,3 +407,2 @@ return data;

let store = this;
let txn_handle;
function resetCursor() {

@@ -423,5 +418,2 @@ try {

txnAddress = txn.address;
if (!txnAddress) {
throw new Error('Invalid transaction, it has no address');
}
cursor = null;

@@ -442,3 +434,3 @@ } else {

cursorAddress = cursor.address;
if (txn.use) txn.use(); // track transaction so we always use the same one
txn.refCount = (txn.refCount || 0) + 1; // track transaction so we always use the same one
if (snapshot === false) {

@@ -504,5 +496,6 @@ cursorRenewId = renewId; // use shared read transaction

txn.renewingRefCount--;
txn.done?.();
if (txn.refCount <= 0 && txn.notCurrent) {
if (--txn.refCount <= 0 && txn.notCurrent) {
cursor.close();
txn.abort(); // this is no longer main read txn, abort it now that we are done
txn.isDone = true;
} else {

@@ -509,0 +502,0 @@ if (db.availableCursor || txn != readTxn) {

@@ -34,5 +34,3 @@ export const SKIP = {};

if (iteratorResult.then) {
if (!async) {
throw new Error('Can not synchronously iterate with asynchronous values');
}
if (!async) throw new Error('Can not synchronously iterate with asynchronous values');
return iteratorResult.then(iteratorResult => this.next(iteratorResult), onError);

@@ -39,0 +37,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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc