@grafeo-db/wasm-lite 0.5.30 → 0.5.32
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/grafeo_wasm.d.ts +13 -0
- package/grafeo_wasm_bg.js +40 -0
- package/grafeo_wasm_bg.wasm +0 -0
- package/grafeo_wasm_bg.wasm.d.ts +2 -0
- package/package.json +1 -1
package/grafeo_wasm.d.ts
CHANGED
|
@@ -17,6 +17,15 @@ export class Database {
|
|
|
17
17
|
* Forces re-parsing and re-optimization on next execution.
|
|
18
18
|
*/
|
|
19
19
|
clearPlanCache(): void;
|
|
20
|
+
/**
|
|
21
|
+
* Converts the database to a read-only CompactStore for faster queries.
|
|
22
|
+
*
|
|
23
|
+
* Takes a snapshot of all nodes and edges, builds a columnar store with
|
|
24
|
+
* CSR adjacency, and switches to read-only mode. After this call, write
|
|
25
|
+
* operations will fail. Gives ~60x memory reduction and 100x+ traversal
|
|
26
|
+
* speedup for read-only workloads.
|
|
27
|
+
*/
|
|
28
|
+
compact(): void;
|
|
20
29
|
/**
|
|
21
30
|
* Returns the current schema name, or `undefined` if no schema is set.
|
|
22
31
|
*/
|
|
@@ -178,6 +187,10 @@ export class Database {
|
|
|
178
187
|
* ```
|
|
179
188
|
*/
|
|
180
189
|
static importSnapshot(data: Uint8Array): Database;
|
|
190
|
+
/**
|
|
191
|
+
* Returns high-level database information (counts, mode, features).
|
|
192
|
+
*/
|
|
193
|
+
info(): any;
|
|
181
194
|
/**
|
|
182
195
|
* Returns a hierarchical memory usage breakdown.
|
|
183
196
|
*
|
package/grafeo_wasm_bg.js
CHANGED
|
@@ -31,6 +31,27 @@ export class Database {
|
|
|
31
31
|
clearPlanCache() {
|
|
32
32
|
wasm.database_clearPlanCache(this.__wbg_ptr);
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Converts the database to a read-only CompactStore for faster queries.
|
|
36
|
+
*
|
|
37
|
+
* Takes a snapshot of all nodes and edges, builds a columnar store with
|
|
38
|
+
* CSR adjacency, and switches to read-only mode. After this call, write
|
|
39
|
+
* operations will fail. Gives ~60x memory reduction and 100x+ traversal
|
|
40
|
+
* speedup for read-only workloads.
|
|
41
|
+
*/
|
|
42
|
+
compact() {
|
|
43
|
+
try {
|
|
44
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
45
|
+
wasm.database_compact(retptr, this.__wbg_ptr);
|
|
46
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
47
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
48
|
+
if (r1) {
|
|
49
|
+
throw takeObject(r0);
|
|
50
|
+
}
|
|
51
|
+
} finally {
|
|
52
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
34
55
|
/**
|
|
35
56
|
* Returns the current schema name, or `undefined` if no schema is set.
|
|
36
57
|
* @returns {string | undefined}
|
|
@@ -400,6 +421,25 @@ export class Database {
|
|
|
400
421
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
401
422
|
}
|
|
402
423
|
}
|
|
424
|
+
/**
|
|
425
|
+
* Returns high-level database information (counts, mode, features).
|
|
426
|
+
* @returns {any}
|
|
427
|
+
*/
|
|
428
|
+
info() {
|
|
429
|
+
try {
|
|
430
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
431
|
+
wasm.database_info(retptr, this.__wbg_ptr);
|
|
432
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
433
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
434
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
435
|
+
if (r2) {
|
|
436
|
+
throw takeObject(r1);
|
|
437
|
+
}
|
|
438
|
+
return takeObject(r0);
|
|
439
|
+
} finally {
|
|
440
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
403
443
|
/**
|
|
404
444
|
* Returns a hierarchical memory usage breakdown.
|
|
405
445
|
*
|
package/grafeo_wasm_bg.wasm
CHANGED
|
Binary file
|
package/grafeo_wasm_bg.wasm.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const __wbg_database_free: (a: number, b: number) => void;
|
|
5
5
|
export const database_clearPlanCache: (a: number) => void;
|
|
6
|
+
export const database_compact: (a: number, b: number) => void;
|
|
6
7
|
export const database_currentSchema: (a: number, b: number) => void;
|
|
7
8
|
export const database_edgeCount: (a: number) => number;
|
|
8
9
|
export const database_execute: (a: number, b: number, c: number, d: number) => void;
|
|
@@ -15,6 +16,7 @@ export const database_exportSnapshot: (a: number, b: number) => void;
|
|
|
15
16
|
export const database_importLpg: (a: number, b: number, c: number) => void;
|
|
16
17
|
export const database_importRows: (a: number, b: number, c: number, d: number) => void;
|
|
17
18
|
export const database_importSnapshot: (a: number, b: number, c: number) => void;
|
|
19
|
+
export const database_info: (a: number, b: number) => void;
|
|
18
20
|
export const database_memoryUsage: (a: number, b: number) => void;
|
|
19
21
|
export const database_new: (a: number) => void;
|
|
20
22
|
export const database_nodeCount: (a: number) => number;
|