@harperfast/rocksdb-js 0.1.5 → 0.1.7
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/README.md +20 -6
- package/dist/index.cjs +8 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -5
- package/dist/index.d.mts +6 -5
- package/dist/index.mjs +8 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +41 -41
package/dist/index.d.mts
CHANGED
|
@@ -398,16 +398,16 @@ type TransactionEntry = {
|
|
|
398
398
|
type TransactionLog = {
|
|
399
399
|
new (name: string): TransactionLog;
|
|
400
400
|
addEntry(data: Buffer | Uint8Array, txnId?: number): void;
|
|
401
|
+
getLogFileSize(sequenceId?: number): number;
|
|
402
|
+
path: string;
|
|
401
403
|
query(options?: TransactionLogQueryOptions): IterableIterator<TransactionEntry>;
|
|
402
|
-
|
|
404
|
+
_currentLogBuffer: LogBuffer;
|
|
405
|
+
_findPosition(timestamp: number): number;
|
|
403
406
|
_getLastCommittedPosition(): Buffer;
|
|
407
|
+
_getLastFlushed(): number;
|
|
404
408
|
_getMemoryMapOfFile(sequenceId: number): LogBuffer | undefined;
|
|
405
|
-
getLogFileSize(sequenceId?: number): number;
|
|
406
|
-
_getLastCommittedPosition(): Buffer;
|
|
407
|
-
_findPosition(timestamp: number): number;
|
|
408
409
|
_lastCommittedPosition: Float64Array;
|
|
409
410
|
_logBuffers: Map<number, WeakRef<LogBuffer>>;
|
|
410
|
-
_currentLogBuffer: LogBuffer;
|
|
411
411
|
};
|
|
412
412
|
type NativeDatabaseMode = "optimistic" | "pessimistic";
|
|
413
413
|
type NativeDatabaseOptions = {
|
|
@@ -425,6 +425,7 @@ type ResolveCallback<T> = (value: T) => void;
|
|
|
425
425
|
type RejectCallback = (err: Error) => void;
|
|
426
426
|
type UserSharedBufferCallback = () => void;
|
|
427
427
|
type PurgeLogsOptions = {
|
|
428
|
+
before?: number;
|
|
428
429
|
destroy?: boolean;
|
|
429
430
|
name?: string;
|
|
430
431
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -3,9 +3,9 @@ import { execSync } from "node:child_process";
|
|
|
3
3
|
import { closeSync, openSync, readFileSync, readSync, readdirSync, statSync } from "node:fs";
|
|
4
4
|
import { dirname, join, resolve } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
|
-
import { Encoder } from "msgpackr";
|
|
7
6
|
import * as orderedBinary from "ordered-binary";
|
|
8
7
|
import { ExtendedIterable } from "@harperfast/extended-iterable";
|
|
8
|
+
import { Encoder } from "msgpackr";
|
|
9
9
|
|
|
10
10
|
//#region \0rolldown/runtime.js
|
|
11
11
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
@@ -38,7 +38,12 @@ function locateBinding() {
|
|
|
38
38
|
const report = process.report.getReport();
|
|
39
39
|
isMusl = (!report?.header || !report.header.glibcVersionRuntime) && Array.isArray(report?.sharedObjects) && report.sharedObjects.some((obj) => obj.includes("libc.musl-") || obj.includes("ld-musl-"));
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
try {
|
|
42
|
+
isMusl = isMusl || execSync("ldd --version", {
|
|
43
|
+
encoding: "utf8",
|
|
44
|
+
stdio: "pipe"
|
|
45
|
+
}).includes("musl");
|
|
46
|
+
} catch {}
|
|
42
47
|
}
|
|
43
48
|
runtime = isMusl ? "-musl" : "-glibc";
|
|
44
49
|
}
|
|
@@ -1786,7 +1791,7 @@ function loadLastPosition(transactionLog, readUncommitted) {
|
|
|
1786
1791
|
//#region src/index.ts
|
|
1787
1792
|
const versions = {
|
|
1788
1793
|
rocksdb: version,
|
|
1789
|
-
"rocksdb-js": "0.1.
|
|
1794
|
+
"rocksdb-js": "0.1.7"
|
|
1790
1795
|
};
|
|
1791
1796
|
|
|
1792
1797
|
//#endregion
|