@grafeo-db/wasm-lite 0.5.23 → 0.5.25
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 +22 -0
- package/grafeo_wasm_bg.js +45 -0
- package/grafeo_wasm_bg.wasm +0 -0
- package/grafeo_wasm_bg.wasm.d.ts +3 -0
- package/package.json +1 -1
package/grafeo_wasm.d.ts
CHANGED
|
@@ -17,6 +17,10 @@ export class Database {
|
|
|
17
17
|
* Forces re-parsing and re-optimization on next execution.
|
|
18
18
|
*/
|
|
19
19
|
clearPlanCache(): void;
|
|
20
|
+
/**
|
|
21
|
+
* Returns the current schema name, or `undefined` if no schema is set.
|
|
22
|
+
*/
|
|
23
|
+
currentSchema(): string | undefined;
|
|
20
24
|
/**
|
|
21
25
|
* Returns the number of edges in the database.
|
|
22
26
|
*/
|
|
@@ -197,6 +201,12 @@ export class Database {
|
|
|
197
201
|
* Returns the number of nodes in the database.
|
|
198
202
|
*/
|
|
199
203
|
nodeCount(): number;
|
|
204
|
+
/**
|
|
205
|
+
* Clears the current schema context.
|
|
206
|
+
*
|
|
207
|
+
* Subsequent `execute()` calls will use the default (no-schema) namespace.
|
|
208
|
+
*/
|
|
209
|
+
resetSchema(): void;
|
|
200
210
|
/**
|
|
201
211
|
* Returns schema information about the database.
|
|
202
212
|
*
|
|
@@ -208,6 +218,18 @@ export class Database {
|
|
|
208
218
|
* ```
|
|
209
219
|
*/
|
|
210
220
|
schema(): any;
|
|
221
|
+
/**
|
|
222
|
+
* Sets the current schema for subsequent `execute()` calls.
|
|
223
|
+
*
|
|
224
|
+
* Equivalent to `SESSION SET SCHEMA name` but persists across calls.
|
|
225
|
+
* Call `resetSchema()` to clear it.
|
|
226
|
+
*
|
|
227
|
+
* ```js
|
|
228
|
+
* db.setSchema("reporting");
|
|
229
|
+
* const types = db.execute("SHOW GRAPH TYPES"); // only sees 'reporting' types
|
|
230
|
+
* ```
|
|
231
|
+
*/
|
|
232
|
+
setSchema(name: string): void;
|
|
211
233
|
/**
|
|
212
234
|
* Returns the Grafeo version.
|
|
213
235
|
*/
|
package/grafeo_wasm_bg.js
CHANGED
|
@@ -31,6 +31,26 @@ export class Database {
|
|
|
31
31
|
clearPlanCache() {
|
|
32
32
|
wasm.database_clearPlanCache(this.__wbg_ptr);
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Returns the current schema name, or `undefined` if no schema is set.
|
|
36
|
+
* @returns {string | undefined}
|
|
37
|
+
*/
|
|
38
|
+
currentSchema() {
|
|
39
|
+
try {
|
|
40
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
41
|
+
wasm.database_currentSchema(retptr, this.__wbg_ptr);
|
|
42
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
43
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
44
|
+
let v1;
|
|
45
|
+
if (r0 !== 0) {
|
|
46
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
47
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
48
|
+
}
|
|
49
|
+
return v1;
|
|
50
|
+
} finally {
|
|
51
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
34
54
|
/**
|
|
35
55
|
* Returns the number of edges in the database.
|
|
36
56
|
* @returns {number}
|
|
@@ -438,6 +458,14 @@ export class Database {
|
|
|
438
458
|
const ret = wasm.database_nodeCount(this.__wbg_ptr);
|
|
439
459
|
return ret >>> 0;
|
|
440
460
|
}
|
|
461
|
+
/**
|
|
462
|
+
* Clears the current schema context.
|
|
463
|
+
*
|
|
464
|
+
* Subsequent `execute()` calls will use the default (no-schema) namespace.
|
|
465
|
+
*/
|
|
466
|
+
resetSchema() {
|
|
467
|
+
wasm.database_resetSchema(this.__wbg_ptr);
|
|
468
|
+
}
|
|
441
469
|
/**
|
|
442
470
|
* Returns schema information about the database.
|
|
443
471
|
*
|
|
@@ -464,6 +492,23 @@ export class Database {
|
|
|
464
492
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
465
493
|
}
|
|
466
494
|
}
|
|
495
|
+
/**
|
|
496
|
+
* Sets the current schema for subsequent `execute()` calls.
|
|
497
|
+
*
|
|
498
|
+
* Equivalent to `SESSION SET SCHEMA name` but persists across calls.
|
|
499
|
+
* Call `resetSchema()` to clear it.
|
|
500
|
+
*
|
|
501
|
+
* ```js
|
|
502
|
+
* db.setSchema("reporting");
|
|
503
|
+
* const types = db.execute("SHOW GRAPH TYPES"); // only sees 'reporting' types
|
|
504
|
+
* ```
|
|
505
|
+
* @param {string} name
|
|
506
|
+
*/
|
|
507
|
+
setSchema(name) {
|
|
508
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
509
|
+
const len0 = WASM_VECTOR_LEN;
|
|
510
|
+
wasm.database_setSchema(this.__wbg_ptr, ptr0, len0);
|
|
511
|
+
}
|
|
467
512
|
/**
|
|
468
513
|
* Returns the Grafeo version.
|
|
469
514
|
* @returns {string}
|
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_currentSchema: (a: number, b: number) => void;
|
|
6
7
|
export const database_edgeCount: (a: number) => number;
|
|
7
8
|
export const database_execute: (a: number, b: number, c: number, d: number) => void;
|
|
8
9
|
export const database_executeRaw: (a: number, b: number, c: number, d: number) => void;
|
|
@@ -17,7 +18,9 @@ export const database_importSnapshot: (a: number, b: number, c: number) => void;
|
|
|
17
18
|
export const database_memoryUsage: (a: number, b: number) => void;
|
|
18
19
|
export const database_new: (a: number) => void;
|
|
19
20
|
export const database_nodeCount: (a: number) => number;
|
|
21
|
+
export const database_resetSchema: (a: number) => void;
|
|
20
22
|
export const database_schema: (a: number, b: number) => void;
|
|
23
|
+
export const database_setSchema: (a: number, b: number, c: number) => void;
|
|
21
24
|
export const database_version: (a: number) => void;
|
|
22
25
|
export const __wbindgen_export: (a: number, b: number) => number;
|
|
23
26
|
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|