@wiscale/velesdb-wasm 1.10.0 → 1.11.0

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/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "Julien Lange <contact@wiscale.fr>"
6
6
  ],
7
7
  "description": "VelesDB for WebAssembly - Vector search in the browser",
8
- "version": "1.10.0",
8
+ "version": "1.11.0",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
package/velesdb_wasm.d.ts CHANGED
@@ -324,6 +324,14 @@ export class ParsedQuery {
324
324
  private constructor();
325
325
  free(): void;
326
326
  [Symbol.dispose](): void;
327
+ /**
328
+ * Get the collection name from the FROM clause, DDL, or DML statement.
329
+ *
330
+ * For DDL statements, returns the collection name from the DDL AST.
331
+ * For DML statements, returns the collection from the DML struct.
332
+ * Alias: `tableName` is kept for backward compatibility.
333
+ */
334
+ readonly collectionName: string | undefined;
327
335
  /**
328
336
  * Get the list of selected columns as JSON array.
329
337
  */
@@ -360,6 +368,22 @@ export class ParsedQuery {
360
368
  * Check if the query has a WHERE clause.
361
369
  */
362
370
  readonly hasWhereClause: boolean;
371
+ /**
372
+ * Check if this is a DDL query (CREATE/DROP COLLECTION).
373
+ */
374
+ readonly isDdl: boolean;
375
+ /**
376
+ * Check if this is a DELETE statement (DELETE FROM or DELETE EDGE).
377
+ */
378
+ readonly isDelete: boolean;
379
+ /**
380
+ * Check if this is a DML mutation (INSERT/UPDATE/DELETE/INSERT EDGE/DELETE EDGE).
381
+ */
382
+ readonly isDml: boolean;
383
+ /**
384
+ * Check if this is an INSERT EDGE statement.
385
+ */
386
+ readonly isInsertEdge: boolean;
363
387
  /**
364
388
  * Check if this is a MATCH (graph) query.
365
389
  */
@@ -419,7 +443,7 @@ export class ParsedQuery {
419
443
  */
420
444
  readonly orderBy: any;
421
445
  /**
422
- * Get the table name from the FROM clause.
446
+ * Legacy alias for `collectionName`. Prefer `collectionName`.
423
447
  */
424
448
  readonly tableName: string | undefined;
425
449
  }
@@ -898,6 +922,7 @@ export interface InitOutput {
898
922
  readonly graphworkerconfig_for_responsive_ui: () => number;
899
923
  readonly graphworkerconfig_new: () => number;
900
924
  readonly hybrid_search_fuse: (a: number, b: number, c: number, d: number, e: number) => void;
925
+ readonly parsedquery_collectionName: (a: number, b: number) => void;
901
926
  readonly parsedquery_columns: (a: number) => number;
902
927
  readonly parsedquery_groupBy: (a: number) => number;
903
928
  readonly parsedquery_hasDistinct: (a: number) => number;
@@ -907,6 +932,10 @@ export interface InitOutput {
907
932
  readonly parsedquery_hasOrderBy: (a: number) => number;
908
933
  readonly parsedquery_hasVectorSearch: (a: number) => number;
909
934
  readonly parsedquery_hasWhereClause: (a: number) => number;
935
+ readonly parsedquery_isDdl: (a: number) => number;
936
+ readonly parsedquery_isDelete: (a: number) => number;
937
+ readonly parsedquery_isDml: (a: number) => number;
938
+ readonly parsedquery_isInsertEdge: (a: number) => number;
910
939
  readonly parsedquery_isMatch: (a: number) => number;
911
940
  readonly parsedquery_isSelect: (a: number) => number;
912
941
  readonly parsedquery_isValid: (a: number) => number;
@@ -921,7 +950,6 @@ export interface InitOutput {
921
950
  readonly parsedquery_matchReturnItems: (a: number) => number;
922
951
  readonly parsedquery_offset: (a: number, b: number) => void;
923
952
  readonly parsedquery_orderBy: (a: number) => number;
924
- readonly parsedquery_tableName: (a: number, b: number) => void;
925
953
  readonly semanticmemory_clear: (a: number) => void;
926
954
  readonly semanticmemory_dimension: (a: number) => number;
927
955
  readonly semanticmemory_is_empty: (a: number) => number;
@@ -980,13 +1008,14 @@ export interface InitOutput {
980
1008
  readonly __wbg_get_traversalprogress_estimated_total: (a: number) => number;
981
1009
  readonly __wbg_get_traversalprogress_visited_count: (a: number) => number;
982
1010
  readonly graphnode_id: (a: number) => bigint;
1011
+ readonly parsedquery_tableName: (a: number, b: number) => void;
983
1012
  readonly __wbg_get_traversalprogress_is_complete: (a: number) => number;
984
1013
  readonly __wbg_traversalprogress_free: (a: number, b: number) => void;
985
- readonly __wasm_bindgen_func_elem_1137: (a: number, b: number) => void;
986
- readonly __wasm_bindgen_func_elem_287: (a: number, b: number) => void;
987
- readonly __wasm_bindgen_func_elem_1138: (a: number, b: number, c: number, d: number) => void;
988
- readonly __wasm_bindgen_func_elem_1385: (a: number, b: number, c: number, d: number) => void;
989
- readonly __wasm_bindgen_func_elem_288: (a: number, b: number, c: number) => void;
1014
+ readonly __wasm_bindgen_func_elem_1231: (a: number, b: number) => void;
1015
+ readonly __wasm_bindgen_func_elem_288: (a: number, b: number) => void;
1016
+ readonly __wasm_bindgen_func_elem_1232: (a: number, b: number, c: number, d: number) => void;
1017
+ readonly __wasm_bindgen_func_elem_1479: (a: number, b: number, c: number, d: number) => void;
1018
+ readonly __wasm_bindgen_func_elem_289: (a: number, b: number, c: number) => void;
990
1019
  readonly __wbindgen_export: (a: number, b: number) => number;
991
1020
  readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
992
1021
  readonly __wbindgen_export3: (a: number) => void;
package/velesdb_wasm.js CHANGED
@@ -886,6 +886,30 @@ export class ParsedQuery {
886
886
  const ptr = this.__destroy_into_raw();
887
887
  wasm.__wbg_parsedquery_free(ptr, 0);
888
888
  }
889
+ /**
890
+ * Get the collection name from the FROM clause, DDL, or DML statement.
891
+ *
892
+ * For DDL statements, returns the collection name from the DDL AST.
893
+ * For DML statements, returns the collection from the DML struct.
894
+ * Alias: `tableName` is kept for backward compatibility.
895
+ * @returns {string | undefined}
896
+ */
897
+ get collectionName() {
898
+ try {
899
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
900
+ wasm.parsedquery_collectionName(retptr, this.__wbg_ptr);
901
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
902
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
903
+ let v1;
904
+ if (r0 !== 0) {
905
+ v1 = getStringFromWasm0(r0, r1).slice();
906
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
907
+ }
908
+ return v1;
909
+ } finally {
910
+ wasm.__wbindgen_add_to_stack_pointer(16);
911
+ }
912
+ }
889
913
  /**
890
914
  * Get the list of selected columns as JSON array.
891
915
  * @returns {any}
@@ -958,6 +982,38 @@ export class ParsedQuery {
958
982
  const ret = wasm.parsedquery_hasWhereClause(this.__wbg_ptr);
959
983
  return ret !== 0;
960
984
  }
985
+ /**
986
+ * Check if this is a DDL query (CREATE/DROP COLLECTION).
987
+ * @returns {boolean}
988
+ */
989
+ get isDdl() {
990
+ const ret = wasm.parsedquery_isDdl(this.__wbg_ptr);
991
+ return ret !== 0;
992
+ }
993
+ /**
994
+ * Check if this is a DELETE statement (DELETE FROM or DELETE EDGE).
995
+ * @returns {boolean}
996
+ */
997
+ get isDelete() {
998
+ const ret = wasm.parsedquery_isDelete(this.__wbg_ptr);
999
+ return ret !== 0;
1000
+ }
1001
+ /**
1002
+ * Check if this is a DML mutation (INSERT/UPDATE/DELETE/INSERT EDGE/DELETE EDGE).
1003
+ * @returns {boolean}
1004
+ */
1005
+ get isDml() {
1006
+ const ret = wasm.parsedquery_isDml(this.__wbg_ptr);
1007
+ return ret !== 0;
1008
+ }
1009
+ /**
1010
+ * Check if this is an INSERT EDGE statement.
1011
+ * @returns {boolean}
1012
+ */
1013
+ get isInsertEdge() {
1014
+ const ret = wasm.parsedquery_isInsertEdge(this.__wbg_ptr);
1015
+ return ret !== 0;
1016
+ }
961
1017
  /**
962
1018
  * Check if this is a MATCH (graph) query.
963
1019
  * @returns {boolean}
@@ -1094,7 +1150,7 @@ export class ParsedQuery {
1094
1150
  return takeObject(ret);
1095
1151
  }
1096
1152
  /**
1097
- * Get the table name from the FROM clause.
1153
+ * Legacy alias for `collectionName`. Prefer `collectionName`.
1098
1154
  * @returns {string | undefined}
1099
1155
  */
1100
1156
  get tableName() {
@@ -2543,7 +2599,7 @@ function __wbg_get_imports() {
2543
2599
  const a = state0.a;
2544
2600
  state0.a = 0;
2545
2601
  try {
2546
- return __wasm_bindgen_func_elem_1385(a, state0.b, arg0, arg1);
2602
+ return __wasm_bindgen_func_elem_1479(a, state0.b, arg0, arg1);
2547
2603
  } finally {
2548
2604
  state0.a = a;
2549
2605
  }
@@ -2565,7 +2621,7 @@ function __wbg_get_imports() {
2565
2621
  const a = state0.a;
2566
2622
  state0.a = 0;
2567
2623
  try {
2568
- return __wasm_bindgen_func_elem_1385(a, state0.b, arg0, arg1);
2624
+ return __wasm_bindgen_func_elem_1479(a, state0.b, arg0, arg1);
2569
2625
  } finally {
2570
2626
  state0.a = a;
2571
2627
  }
@@ -2698,13 +2754,13 @@ function __wbg_get_imports() {
2698
2754
  return addHeapObject(ret);
2699
2755
  },
2700
2756
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
2701
- // Cast intrinsic for `Closure(Closure { dtor_idx: 143, function: Function { arguments: [Externref], shim_idx: 144, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
2702
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_1137, __wasm_bindgen_func_elem_1138);
2757
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 144, function: Function { arguments: [Externref], shim_idx: 145, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
2758
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_1231, __wasm_bindgen_func_elem_1232);
2703
2759
  return addHeapObject(ret);
2704
2760
  },
2705
2761
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
2706
2762
  // Cast intrinsic for `Closure(Closure { dtor_idx: 9, function: Function { arguments: [NamedExternref("Event")], shim_idx: 10, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2707
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_287, __wasm_bindgen_func_elem_288);
2763
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_288, __wasm_bindgen_func_elem_289);
2708
2764
  return addHeapObject(ret);
2709
2765
  },
2710
2766
  __wbindgen_cast_0000000000000003: function(arg0) {
@@ -2741,14 +2797,14 @@ function __wbg_get_imports() {
2741
2797
  };
2742
2798
  }
2743
2799
 
2744
- function __wasm_bindgen_func_elem_288(arg0, arg1, arg2) {
2745
- wasm.__wasm_bindgen_func_elem_288(arg0, arg1, addHeapObject(arg2));
2800
+ function __wasm_bindgen_func_elem_289(arg0, arg1, arg2) {
2801
+ wasm.__wasm_bindgen_func_elem_289(arg0, arg1, addHeapObject(arg2));
2746
2802
  }
2747
2803
 
2748
- function __wasm_bindgen_func_elem_1138(arg0, arg1, arg2) {
2804
+ function __wasm_bindgen_func_elem_1232(arg0, arg1, arg2) {
2749
2805
  try {
2750
2806
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2751
- wasm.__wasm_bindgen_func_elem_1138(retptr, arg0, arg1, addHeapObject(arg2));
2807
+ wasm.__wasm_bindgen_func_elem_1232(retptr, arg0, arg1, addHeapObject(arg2));
2752
2808
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2753
2809
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2754
2810
  if (r1) {
@@ -2759,8 +2815,8 @@ function __wasm_bindgen_func_elem_1138(arg0, arg1, arg2) {
2759
2815
  }
2760
2816
  }
2761
2817
 
2762
- function __wasm_bindgen_func_elem_1385(arg0, arg1, arg2, arg3) {
2763
- wasm.__wasm_bindgen_func_elem_1385(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
2818
+ function __wasm_bindgen_func_elem_1479(arg0, arg1, arg2, arg3) {
2819
+ wasm.__wasm_bindgen_func_elem_1479(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
2764
2820
  }
2765
2821
 
2766
2822
 
Binary file