@grafeo-db/wasm-lite 0.5.31 → 0.5.33

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 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
  */
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}
Binary file
@@ -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;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@grafeo-db/wasm-lite",
3
3
  "type": "module",
4
- "version": "0.5.31",
4
+ "version": "0.5.33",
5
5
  "description": "WebAssembly bindings for Grafeo - GQL-only lightweight variant",
6
6
  "keywords": [
7
7
  "graph",