You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+282-2Lines changed: 282 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,10 +17,11 @@ Creates a new database instance.
17
17
-`path: string` The path to write the database files to. This path does not
18
18
need to exist, but the parent directories do.
19
19
-`options: object`[optional]
20
-
-`noBlockCache: boolean` When `true`, disables the block cache. Block caching is enabled by default and the cache is shared across all database instances.
21
20
-`name:string` The column family name. Defaults to `"default"`.
21
+
-`noBlockCache: boolean` When `true`, disables the block cache. Block caching is enabled by default and the cache is shared across all database instances.
22
22
-`parallelismThreads: number` The number of background threads to use for flush and compaction. Defaults to `1`.
23
23
-`pessimistic: boolean` When `true`, throws conflict errors when they occur instead of waiting until commit. Defaults to `false`.
24
+
-`store: Store` A custom store that handles all interaction between the `RocksDatabase` or `Transaction` instances and the native database interface. See [Custom Store](#custom-store) for more information.
24
25
25
26
### `db.config(options)`
26
27
@@ -82,6 +83,72 @@ Note that all errors are returned as rejected promises.
82
83
83
84
Synchronous version of `get()`.
84
85
86
+
### `db.getEntry(key): MaybePromise`
87
+
88
+
Retrieves a value for the given key as an "entry" object.
-`adaptiveReadahead: boolean` When `true`, RocksDB will do some enhancements for prefetching the data. Defaults to `true`. Note that RocksDB defaults this to `false`.
412
+
-`asyncIO: boolean` When `true`, RocksDB will prefetch some data async and apply it if reads are sequential and its internal automatic prefetching. Defaults to `true`. Note that RocksDB defaults this to `false`.
413
+
-`autoReadaheadSize: boolean` When `true`, RocksDB will auto-tune the readahead size during scans internally based on the block cache data when block caching is enabled, an end key (e.g. upper bound) is set, and prefix is the same as the start key. Defaults to `true`.
414
+
-`backgroundPurgeOnIteratorCleanup: boolean` When `true`, after the iterator is closed, a background job is scheduled to flush the job queue and delete obsolete files. Defaults to `true`. Note that RocksDB defaults this to `false`.
415
+
-`fillCache: boolean` When `true`, the iterator will fill the block cache. Filling the block cache is not desirable for bulk scans and could impact eviction order. Defaults to `false`. Note that RocksDB defaults this to `true`.
416
+
-`readaheadSize: number` The RocksDB readahead size. RocksDB does auto-readahead for iterators when there is more than two reads for a table file. The readahead starts at 8KB and doubles on every additional read up to 256KB. This option can help if most of the range scans are large and if a larger readahead than that enabled by auto-readahead is needed. Using a large readahead size (> 2MB) can typically improve the performance of forward iteration on spinning disks. Defaults to `0`.
417
+
-`tailing: boolean` When `true`, creates a "tailing iterator" which is a special iterator that has a view of the complete database including newly added data and
418
+
is optimized for sequential reads. This will return records that were inserted into the database after the creation of the iterator. Defaults to `false`.
419
+
420
+
### `RangeOptions`
421
+
422
+
Extends `RocksDBOptions`.
423
+
424
+
-`options: object`
425
+
-`end: Key | Uint8Array` The range end key, otherwise known as the "upper bound". Defaults to the last key in the database.
426
+
-`exclusiveStart: boolean` When `true`, the iterator will exclude the first key if it matches the start key. Defaults to `false`.
427
+
-`inclusiveEnd: boolean` When `true`, the iterator will include the last key if it matches the end key. Defaults to `false`.
428
+
-`start: Key | Uint8Array` The range start key, otherwise known as the "lower bound". Defaults to the first key in the database.
429
+
430
+
### `IteratorOptions`
431
+
432
+
Extends `RangeOptions`.
433
+
434
+
-`options: object`
435
+
-`reverse: boolean` When `true`, the iterator will iterate in reverse order. Defaults to `false`.
436
+
157
437
## Development
158
438
159
439
This package requires Node.js 18 or higher, pnpm, and a C++ compiler.
@@ -172,7 +452,7 @@ To compile everything including the native binding and the TypeScript source, ru
172
452
pnpm build
173
453
```
174
454
175
-
To compile only the native binding, run:
455
+
To configure and compile only the native binding, run:
0 commit comments