@harperfast/rocksdb-js 0.1.6 → 0.1.8
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 +7 -6
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +41 -41
package/README.md
CHANGED
|
@@ -217,7 +217,7 @@ synchronously instead of returning a promise.
|
|
|
217
217
|
|
|
218
218
|
```typescript
|
|
219
219
|
const result = db.get('foo');
|
|
220
|
-
const value = result instanceof Promise ?
|
|
220
|
+
const value = result instanceof Promise ? await result : result;
|
|
221
221
|
assert.equal(result, 'foo');
|
|
222
222
|
```
|
|
223
223
|
|
|
@@ -675,11 +675,11 @@ available.
|
|
|
675
675
|
await Promise.all([
|
|
676
676
|
db.withLock('key', () => {
|
|
677
677
|
console.log('first lock blocking for 100ms');
|
|
678
|
-
return new Promise(resolve => setTimeout(resolve, 100));
|
|
678
|
+
return new Promise((resolve) => setTimeout(resolve, 100));
|
|
679
679
|
}),
|
|
680
680
|
db.withLock('key', () => {
|
|
681
681
|
console.log('second lock blocking for 100ms');
|
|
682
|
-
return new Promise(resolve => setTimeout(resolve, 100));
|
|
682
|
+
return new Promise((resolve) => setTimeout(resolve, 100));
|
|
683
683
|
}),
|
|
684
684
|
db.withLock('key', () => {
|
|
685
685
|
console.log('third lock acquired');
|
|
@@ -729,6 +729,7 @@ const names = db.listLogs();
|
|
|
729
729
|
Deletes transaction log files older than the `transactionLogRetention` (defaults to 3 days).
|
|
730
730
|
|
|
731
731
|
- `options: object`
|
|
732
|
+
- `before?: number` Remove all transaction log files older than the specified timestamp.
|
|
732
733
|
- `destroy?: boolean` When `true`, deletes transaction log stores including all log sequence files
|
|
733
734
|
on disk.
|
|
734
735
|
- `name?: string` The name of a store to limit the purging to.
|
|
@@ -851,7 +852,7 @@ for (const entry of iter) {
|
|
|
851
852
|
console.log(entry);
|
|
852
853
|
}
|
|
853
854
|
|
|
854
|
-
const lastHour = Date.now() -
|
|
855
|
+
const lastHour = Date.now() - 60 * 60 * 1000;
|
|
855
856
|
const rangeIter = log.query({ start: lastHour, end: Date.now() });
|
|
856
857
|
for (const entry of rangeIter) {
|
|
857
858
|
console.log(entry.timestamp, entry.data);
|
|
@@ -892,11 +893,11 @@ Returns an array containing that status of all active RocksDB instances.
|
|
|
892
893
|
|
|
893
894
|
- `path: string` The database path.
|
|
894
895
|
- `refCount: number` The number of JavaScript database instances plus the registry's reference.
|
|
895
|
-
- `columnFamiles:
|
|
896
|
+
- `columnFamiles: object` A map of column family names and their their info.
|
|
897
|
+
- `userSharedBuffers: number` The count of active user shared buffers.
|
|
896
898
|
- `transactions: number` The count of active transactions.
|
|
897
899
|
- `closables: number` The count of active database, transactions, and iterators.
|
|
898
900
|
- `locks: number` The count of active locks.
|
|
899
|
-
- `userSharedBuffers: number` The count of active user shared buffers.
|
|
900
901
|
- `listenerCallbacks: number` The count of in-flight callbacks.
|
|
901
902
|
|
|
902
903
|
```typescript
|
package/dist/index.cjs
CHANGED
|
@@ -31,10 +31,10 @@ let node_fs = require("node:fs");
|
|
|
31
31
|
let node_module = require("node:module");
|
|
32
32
|
let node_path = require("node:path");
|
|
33
33
|
let node_url = require("node:url");
|
|
34
|
-
let msgpackr = require("msgpackr");
|
|
35
34
|
let ordered_binary = require("ordered-binary");
|
|
36
35
|
ordered_binary = __toESM(ordered_binary);
|
|
37
36
|
let _harperfast_extended_iterable = require("@harperfast/extended-iterable");
|
|
37
|
+
let msgpackr = require("msgpackr");
|
|
38
38
|
|
|
39
39
|
//#region src/load-binding.ts
|
|
40
40
|
const nativeExtRE = /\.node$/;
|
|
@@ -1816,7 +1816,7 @@ function loadLastPosition(transactionLog, readUncommitted) {
|
|
|
1816
1816
|
//#region src/index.ts
|
|
1817
1817
|
const versions = {
|
|
1818
1818
|
rocksdb: version,
|
|
1819
|
-
"rocksdb-js": "0.1.
|
|
1819
|
+
"rocksdb-js": "0.1.8"
|
|
1820
1820
|
};
|
|
1821
1821
|
|
|
1822
1822
|
//#endregion
|