-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDatabaseInterface.ts
More file actions
42 lines (37 loc) · 1.03 KB
/
DatabaseInterface.ts
File metadata and controls
42 lines (37 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import type { RocksDatabase } from '@harperfast/rocksdb-js';
import type { Database, RootDatabase } from 'lmdb';
export interface LMDBDatabase extends Database {
customIndex?: any;
isIndexing?: boolean;
indexNulls?: boolean;
}
export interface LMDBRootDatabase extends RootDatabase {
auditStore?: LMDBRootDatabase;
databaseName?: string;
dbisDb?: LMDBDatabase;
isLegacy?: boolean;
needsDeletion?: boolean;
path?: string;
status?: 'open' | 'closed';
}
export interface RocksDatabaseEx extends RocksDatabase {
customIndex?: any;
env: Record<string, any>;
isLegacy?: boolean;
isIndexing?: boolean;
indexNulls?: boolean;
getEntry?: (id: string | number | (string | number)[] | Buffer, options?: any) => { value: any };
}
export interface RocksRootDatabase extends RocksDatabaseEx {
auditStore?: RocksDatabaseEx;
databaseName?: string;
dbisDb?: RocksDatabaseEx;
}
export type DBI =
| LMDBDatabase
| (RocksDatabase & {
customIndex?: any;
isIndexing?: boolean;
indexNulls?: boolean;
rootStore?: RocksRootDatabase;
});