@harperfast/rocksdb-js 1.5.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +3 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +23 -23
package/dist/index.cjs
CHANGED
|
@@ -599,8 +599,6 @@ const VALUE_BUFFER = createFixedBuffer(64 * 1024);
|
|
|
599
599
|
const ITERATOR_STATE_BUFFER = Buffer.allocUnsafeSlow(8);
|
|
600
600
|
const ITERATOR_STATE = new Uint32Array(ITERATOR_STATE_BUFFER.buffer, ITERATOR_STATE_BUFFER.byteOffset, 2);
|
|
601
601
|
const MAX_KEY_SIZE = 1024 * 1024;
|
|
602
|
-
const RESET_BUFFER_MODE = 1024;
|
|
603
|
-
const REUSE_BUFFER_MODE = 512;
|
|
604
602
|
const SAVE_BUFFER_SIZE = 8192;
|
|
605
603
|
/**
|
|
606
604
|
* A store wraps the `NativeDatabase` binding and database settings so that a
|
|
@@ -890,7 +888,7 @@ var Store = class {
|
|
|
890
888
|
encodeValue(value) {
|
|
891
889
|
if (value && value["binary-data"]) return value["binary-data"];
|
|
892
890
|
if (typeof this.encoder?.encode === "function") {
|
|
893
|
-
if (this.encoder.copyBuffers) return this.encoder.encode(value,
|
|
891
|
+
if (this.encoder.copyBuffers) return this.encoder.encode(value, 1536);
|
|
894
892
|
const valueBuffer = this.encoder.encode(value);
|
|
895
893
|
if (typeof valueBuffer === "string") return Buffer.from(valueBuffer);
|
|
896
894
|
return valueBuffer;
|
|
@@ -1919,7 +1917,6 @@ var RocksDatabase = class RocksDatabase extends DBI {
|
|
|
1919
1917
|
//#region src/parse-transaction-log.ts
|
|
1920
1918
|
const { TRANSACTION_LOG_TOKEN, TRANSACTION_LOG_ENTRY_HEADER_SIZE: TRANSACTION_LOG_ENTRY_HEADER_SIZE$1 } = constants;
|
|
1921
1919
|
const MIN_VALID_TIMESTAMP = Date.UTC(2026, 0, 27);
|
|
1922
|
-
const VALID_FLAGS_MASK = 1;
|
|
1923
1920
|
/**
|
|
1924
1921
|
* Loads an entire transaction log file into memory.
|
|
1925
1922
|
* @param path - The path to the transaction log file.
|
|
@@ -1973,7 +1970,7 @@ function parseTransactionLog(path, options = {}) {
|
|
|
1973
1970
|
const data = read(length);
|
|
1974
1971
|
const entryAnomalies = [];
|
|
1975
1972
|
if (!Number.isFinite(timestamp) || timestamp < MIN_VALID_TIMESTAMP) entryAnomalies.push(`timestamp ${timestamp} predates 2026-01-27 (possible corruption)`);
|
|
1976
|
-
if ((flags &
|
|
1973
|
+
if ((flags & -2) !== 0) entryAnomalies.push(`flags 0x${flags.toString(16).padStart(2, "0")} contains undefined bits (expected 0x00 or 0x01)`);
|
|
1977
1974
|
const entry = {
|
|
1978
1975
|
timestamp,
|
|
1979
1976
|
length,
|
|
@@ -2190,7 +2187,7 @@ function loadLastPosition(transactionLog, readUncommitted) {
|
|
|
2190
2187
|
//#region src/index.ts
|
|
2191
2188
|
const versions = {
|
|
2192
2189
|
rocksdb: version,
|
|
2193
|
-
"rocksdb-js": "
|
|
2190
|
+
"rocksdb-js": "2.0.0"
|
|
2194
2191
|
};
|
|
2195
2192
|
|
|
2196
2193
|
//#endregion
|