@ultipa-graph/ultipa-driver 6.0.8 → 6.0.10
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/dist/client.d.ts +79 -61
- package/dist/client.js +216 -143
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/services/query-service.js +9 -1
- package/dist/types/convenience.d.ts +6 -2
- package/dist/types/convenience.js +1 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -17,6 +17,14 @@ export interface QueryConfig {
|
|
|
17
17
|
/** Max paths to return from path queries (0 = unlimited) */
|
|
18
18
|
maxPathResults?: number;
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Configuration for insertNodes / insertEdges convenience methods.
|
|
22
|
+
* Extends QueryConfig with insert-specific options.
|
|
23
|
+
*/
|
|
24
|
+
export interface InsertConfig extends QueryConfig {
|
|
25
|
+
/** Insert mode. Defaults to InsertType.Normal when omitted. */
|
|
26
|
+
insertType?: InsertType;
|
|
27
|
+
}
|
|
20
28
|
/** Configuration for insert nodes */
|
|
21
29
|
export interface InsertNodesConfig {
|
|
22
30
|
options?: BulkCreateNodesOptions;
|
|
@@ -211,9 +219,9 @@ export declare class GqldbClient {
|
|
|
211
219
|
/** Join names with ", " without backtick wrapping */
|
|
212
220
|
private static joinNames;
|
|
213
221
|
/** Create a new open (schema-less) graph */
|
|
214
|
-
createOpenGraph(name: string): Promise<Response>;
|
|
222
|
+
createOpenGraph(name: string, config?: QueryConfig): Promise<Response>;
|
|
215
223
|
/** Create a new closed (schema-enforced) graph with node and edge label definitions */
|
|
216
|
-
createClosedGraph(name: string): Promise<Response>;
|
|
224
|
+
createClosedGraph(name: string, config?: QueryConfig): Promise<Response>;
|
|
217
225
|
/**
|
|
218
226
|
* Create a graph if it does not already exist.
|
|
219
227
|
* Returns true if the graph was created, false if it already existed.
|
|
@@ -222,137 +230,147 @@ export declare class GqldbClient {
|
|
|
222
230
|
/** Check whether a graph with the given name exists */
|
|
223
231
|
hasGraph(name: string): Promise<boolean>;
|
|
224
232
|
/** Rename a graph */
|
|
225
|
-
alterGraph(graphName: string, newName: string): Promise<Response>;
|
|
233
|
+
alterGraph(graphName: string, newName: string, config?: QueryConfig): Promise<Response>;
|
|
226
234
|
/** Remove all data from a graph while keeping its structure */
|
|
227
|
-
truncate(graphName: string): Promise<Response>;
|
|
235
|
+
truncate(graphName: string, config?: QueryConfig): Promise<Response>;
|
|
228
236
|
/** Return all labels (node and edge) in the current graph */
|
|
229
|
-
showLabels(): Promise<LabelInfo[]>;
|
|
237
|
+
showLabels(config?: QueryConfig): Promise<LabelInfo[]>;
|
|
230
238
|
/** Return all node labels in the current graph */
|
|
231
|
-
showNodeLabels(): Promise<LabelInfo[]>;
|
|
239
|
+
showNodeLabels(config?: QueryConfig): Promise<LabelInfo[]>;
|
|
232
240
|
/** Return all edge labels in the current graph */
|
|
233
|
-
showEdgeLabels(): Promise<LabelInfo[]>;
|
|
241
|
+
showEdgeLabels(config?: QueryConfig): Promise<LabelInfo[]>;
|
|
234
242
|
/** Return all node types with their properties */
|
|
235
|
-
showNodeTypes(): Promise<NodeTypeInfo[]>;
|
|
243
|
+
showNodeTypes(config?: QueryConfig): Promise<NodeTypeInfo[]>;
|
|
236
244
|
/** Return all edge types with their properties */
|
|
237
|
-
showEdgeTypes(): Promise<EdgeTypeInfo[]>;
|
|
238
|
-
/**
|
|
239
|
-
|
|
245
|
+
showEdgeTypes(config?: QueryConfig): Promise<EdgeTypeInfo[]>;
|
|
246
|
+
/**
|
|
247
|
+
* Return a specific label by name from the current graph, or null if not found.
|
|
248
|
+
* Matches entries where `name` is one of the .labels (supports multi-label groups).
|
|
249
|
+
*/
|
|
250
|
+
getLabel(name: string, config?: QueryConfig): Promise<LabelInfo | null>;
|
|
240
251
|
/** Return a specific node type by name, or null if not found */
|
|
241
|
-
getNodeLabel(name: string): Promise<NodeTypeInfo | null>;
|
|
252
|
+
getNodeLabel(name: string, config?: QueryConfig): Promise<NodeTypeInfo | null>;
|
|
242
253
|
/** Return a specific edge type by name, or null if not found */
|
|
243
|
-
getEdgeLabel(name: string): Promise<EdgeTypeInfo | null>;
|
|
254
|
+
getEdgeLabel(name: string, config?: QueryConfig): Promise<EdgeTypeInfo | null>;
|
|
244
255
|
/** Create a node label in the current graph (closed graph) */
|
|
245
|
-
createNodeLabel(name: string, props?: ConvPropertyDef[]): Promise<Response>;
|
|
256
|
+
createNodeLabel(name: string, props?: ConvPropertyDef[], config?: QueryConfig): Promise<Response>;
|
|
246
257
|
/** Create an edge label in the current graph (closed graph) */
|
|
247
|
-
createEdgeLabel(name: string, props?: ConvPropertyDef[]): Promise<Response>;
|
|
258
|
+
createEdgeLabel(name: string, props?: ConvPropertyDef[], config?: QueryConfig): Promise<Response>;
|
|
248
259
|
/** Drop a node label from the current graph (closed graph) */
|
|
249
|
-
dropNodeLabel(name: string): Promise<Response>;
|
|
260
|
+
dropNodeLabel(name: string, config?: QueryConfig): Promise<Response>;
|
|
250
261
|
/** Drop one or more edge labels from the current graph (closed graph) */
|
|
251
|
-
dropEdgeLabel(...
|
|
262
|
+
dropEdgeLabel(...namesOrConfig: Array<string | QueryConfig | undefined>): Promise<Response>;
|
|
252
263
|
/**
|
|
253
264
|
* Create a label if it does not already exist.
|
|
254
265
|
* Returns true if created, false if it already existed.
|
|
255
266
|
*/
|
|
256
|
-
createLabelIfNotExist(nodeOrEdge: DBType, name: string, props?: ConvPropertyDef[]): Promise<boolean>;
|
|
267
|
+
createLabelIfNotExist(nodeOrEdge: DBType, name: string, props?: ConvPropertyDef[], config?: QueryConfig): Promise<boolean>;
|
|
257
268
|
/** Rename a node label */
|
|
258
|
-
alterNodeLabel(oldName: string, newName: string): Promise<Response>;
|
|
269
|
+
alterNodeLabel(oldName: string, newName: string, config?: QueryConfig): Promise<Response>;
|
|
259
270
|
/** Rename an edge label */
|
|
260
|
-
alterEdgeLabel(oldName: string, newName: string): Promise<Response>;
|
|
271
|
+
alterEdgeLabel(oldName: string, newName: string, config?: QueryConfig): Promise<Response>;
|
|
261
272
|
/** Return all available algorithms */
|
|
262
|
-
showAlgos(): Promise<AlgoInfo[]>;
|
|
273
|
+
showAlgos(config?: QueryConfig): Promise<AlgoInfo[]>;
|
|
263
274
|
/** Return properties for a label (node or edge) in the current graph */
|
|
264
|
-
showProperty(nodeOrEdge: DBType, labelName: string): Promise<ConvPropertyDef[]>;
|
|
275
|
+
showProperty(nodeOrEdge: DBType, labelName: string, config?: QueryConfig): Promise<ConvPropertyDef[]>;
|
|
265
276
|
/** Return properties for a node label */
|
|
266
|
-
showNodeProperty(labelName: string): Promise<ConvPropertyDef[]>;
|
|
277
|
+
showNodeProperty(labelName: string, config?: QueryConfig): Promise<ConvPropertyDef[]>;
|
|
267
278
|
/** Return properties for an edge label */
|
|
268
|
-
showEdgeProperty(labelName: string): Promise<ConvPropertyDef[]>;
|
|
279
|
+
showEdgeProperty(labelName: string, config?: QueryConfig): Promise<ConvPropertyDef[]>;
|
|
269
280
|
/** Return a specific property definition for a label, or null if not found */
|
|
270
|
-
getProperty(nodeOrEdge: DBType, labelName: string, propName: string): Promise<ConvPropertyDef | null>;
|
|
281
|
+
getProperty(nodeOrEdge: DBType, labelName: string, propName: string, config?: QueryConfig): Promise<ConvPropertyDef | null>;
|
|
271
282
|
/** Return a specific property definition for a node label, or null if not found */
|
|
272
|
-
getNodeProperty(labelName: string, propName: string): Promise<ConvPropertyDef | null>;
|
|
283
|
+
getNodeProperty(labelName: string, propName: string, config?: QueryConfig): Promise<ConvPropertyDef | null>;
|
|
273
284
|
/** Return a specific property definition for an edge label, or null if not found */
|
|
274
|
-
getEdgeProperty(labelName: string, propName: string): Promise<ConvPropertyDef | null>;
|
|
285
|
+
getEdgeProperty(labelName: string, propName: string, config?: QueryConfig): Promise<ConvPropertyDef | null>;
|
|
275
286
|
/** Add properties to a label (node or edge) */
|
|
276
|
-
createProperty(nodeOrEdge: DBType, labelName: string, props: ConvPropertyDef[]): Promise<Response>;
|
|
287
|
+
createProperty(nodeOrEdge: DBType, labelName: string, props: ConvPropertyDef[], config?: QueryConfig): Promise<Response>;
|
|
277
288
|
/** Add properties to a node label */
|
|
278
|
-
createNodeProperty(labelName: string, props: ConvPropertyDef[]): Promise<Response>;
|
|
289
|
+
createNodeProperty(labelName: string, props: ConvPropertyDef[], config?: QueryConfig): Promise<Response>;
|
|
279
290
|
/** Add properties to an edge label */
|
|
280
|
-
createEdgeProperty(labelName: string, props: ConvPropertyDef[]): Promise<Response>;
|
|
291
|
+
createEdgeProperty(labelName: string, props: ConvPropertyDef[], config?: QueryConfig): Promise<Response>;
|
|
281
292
|
/** Drop properties from a label (node or edge) */
|
|
282
|
-
dropProperty(nodeOrEdge: DBType, labelName: string, ...
|
|
293
|
+
dropProperty(nodeOrEdge: DBType, labelName: string, ...propNamesOrConfig: Array<string | QueryConfig | undefined>): Promise<Response>;
|
|
283
294
|
/** Drop properties from a node label */
|
|
284
|
-
dropNodeProperty(labelName: string, ...
|
|
295
|
+
dropNodeProperty(labelName: string, ...propNamesOrConfig: Array<string | QueryConfig | undefined>): Promise<Response>;
|
|
285
296
|
/** Drop properties from an edge label */
|
|
286
|
-
dropEdgeProperty(labelName: string, ...
|
|
297
|
+
dropEdgeProperty(labelName: string, ...propNamesOrConfig: Array<string | QueryConfig | undefined>): Promise<Response>;
|
|
287
298
|
/**
|
|
288
299
|
* Create properties on a label if they do not already exist.
|
|
289
300
|
* Returns true if any properties were created, false if all already existed.
|
|
290
301
|
*/
|
|
291
|
-
createPropertyIfNotExist(nodeOrEdge: DBType, labelName: string, props: ConvPropertyDef[]): Promise<boolean>;
|
|
302
|
+
createPropertyIfNotExist(nodeOrEdge: DBType, labelName: string, props: ConvPropertyDef[], config?: QueryConfig): Promise<boolean>;
|
|
292
303
|
/** Create a NOT NULL constraint on a property */
|
|
293
|
-
createNotNullConstraint(nodeOrEdge: DBType, labelName: string, propName: string): Promise<Response>;
|
|
304
|
+
createNotNullConstraint(nodeOrEdge: DBType, labelName: string, propName: string, config?: QueryConfig): Promise<Response>;
|
|
294
305
|
/** Create a UNIQUE constraint on one or more properties */
|
|
295
|
-
createUniqueConstraint(nodeOrEdge: DBType, labelName: string, ...
|
|
306
|
+
createUniqueConstraint(nodeOrEdge: DBType, labelName: string, ...propNamesOrConfig: Array<string | QueryConfig | undefined>): Promise<Response>;
|
|
296
307
|
/** Remove a NOT NULL constraint from a property */
|
|
297
|
-
dropNotNullConstraint(nodeOrEdge: DBType, labelName: string, propName: string): Promise<Response>;
|
|
308
|
+
dropNotNullConstraint(nodeOrEdge: DBType, labelName: string, propName: string, config?: QueryConfig): Promise<Response>;
|
|
298
309
|
/** Remove a UNIQUE constraint from one or more properties */
|
|
299
|
-
dropUniqueConstraint(nodeOrEdge: DBType, labelName: string, ...
|
|
310
|
+
dropUniqueConstraint(nodeOrEdge: DBType, labelName: string, ...propNamesOrConfig: Array<string | QueryConfig | undefined>): Promise<Response>;
|
|
300
311
|
/** Return all indexes in the current graph */
|
|
301
|
-
showIndex(): Promise<IndexInfo[]>;
|
|
312
|
+
showIndex(config?: QueryConfig): Promise<IndexInfo[]>;
|
|
302
313
|
/** Return all node indexes in the current graph */
|
|
303
|
-
showNodeIndex(): Promise<IndexInfo[]>;
|
|
314
|
+
showNodeIndex(config?: QueryConfig): Promise<IndexInfo[]>;
|
|
304
315
|
/** Return all edge indexes in the current graph */
|
|
305
|
-
showEdgeIndex(): Promise<IndexInfo[]>;
|
|
316
|
+
showEdgeIndex(config?: QueryConfig): Promise<IndexInfo[]>;
|
|
306
317
|
/** Create an index on a node label */
|
|
307
|
-
createNodeIndex(indexName: string, labelName: string, props: IndexProperty[]): Promise<Response>;
|
|
318
|
+
createNodeIndex(indexName: string, labelName: string, props: IndexProperty[], config?: QueryConfig): Promise<Response>;
|
|
308
319
|
/** Create an index on an edge label */
|
|
309
|
-
createEdgeIndex(indexName: string, labelName: string, props: IndexProperty[]): Promise<Response>;
|
|
320
|
+
createEdgeIndex(indexName: string, labelName: string, props: IndexProperty[], config?: QueryConfig): Promise<Response>;
|
|
310
321
|
/** Drop a node index by name */
|
|
311
|
-
dropNodeIndex(indexName: string): Promise<Response>;
|
|
322
|
+
dropNodeIndex(indexName: string, config?: QueryConfig): Promise<Response>;
|
|
312
323
|
/** Drop an edge index by name */
|
|
313
|
-
dropEdgeIndex(indexName: string): Promise<Response>;
|
|
324
|
+
dropEdgeIndex(indexName: string, config?: QueryConfig): Promise<Response>;
|
|
314
325
|
/** Return all fulltext indexes in the current graph */
|
|
315
|
-
showFulltext(): Promise<FulltextInfo[]>;
|
|
326
|
+
showFulltext(config?: QueryConfig): Promise<FulltextInfo[]>;
|
|
316
327
|
/** Return all node fulltext indexes */
|
|
317
|
-
showNodeFulltext(): Promise<FulltextInfo[]>;
|
|
328
|
+
showNodeFulltext(config?: QueryConfig): Promise<FulltextInfo[]>;
|
|
318
329
|
/** Return all edge fulltext indexes */
|
|
319
|
-
showEdgeFulltext(): Promise<FulltextInfo[]>;
|
|
330
|
+
showEdgeFulltext(config?: QueryConfig): Promise<FulltextInfo[]>;
|
|
320
331
|
/** Create a fulltext index on a node label */
|
|
321
|
-
createNodeFulltext(indexName: string, labelName: string, props: string[]): Promise<Response>;
|
|
332
|
+
createNodeFulltext(indexName: string, labelName: string, props: string[], config?: QueryConfig): Promise<Response>;
|
|
322
333
|
/** Create a fulltext index on an edge label */
|
|
323
|
-
createEdgeFulltext(indexName: string, labelName: string, props: string[]): Promise<Response>;
|
|
334
|
+
createEdgeFulltext(indexName: string, labelName: string, props: string[], config?: QueryConfig): Promise<Response>;
|
|
324
335
|
/** Drop a node fulltext index by name */
|
|
325
|
-
dropNodeFulltext(indexName: string): Promise<Response>;
|
|
336
|
+
dropNodeFulltext(indexName: string, config?: QueryConfig): Promise<Response>;
|
|
326
337
|
/** Drop an edge fulltext index by name */
|
|
327
|
-
dropEdgeFulltext(indexName: string): Promise<Response>;
|
|
338
|
+
dropEdgeFulltext(indexName: string, config?: QueryConfig): Promise<Response>;
|
|
328
339
|
/** Return all tasks in the current graph */
|
|
329
|
-
showTasks(): Promise<TaskInfo[]>;
|
|
340
|
+
showTasks(config?: QueryConfig): Promise<TaskInfo[]>;
|
|
330
341
|
/** Delete a task by ID */
|
|
331
|
-
deleteTask(taskId: string): Promise<Response>;
|
|
342
|
+
deleteTask(taskId: string, config?: QueryConfig): Promise<Response>;
|
|
332
343
|
/** Stop a running task by ID */
|
|
333
|
-
stopTask(taskId: string): Promise<Response>;
|
|
334
|
-
/** Insert nodes using GQL INSERT syntax */
|
|
344
|
+
stopTask(taskId: string, config?: QueryConfig): Promise<Response>;
|
|
335
345
|
/**
|
|
336
346
|
* Insert nodes using GQL INSERT syntax with RETURN clause.
|
|
337
347
|
* GQL: INSERT (n0:Label {p1: v1}), (n1:Label {p2: v2}) RETURN n0, n1
|
|
348
|
+
* When config.insertType is InsertType.Overwrite, uses INSERT OVERWRITE syntax.
|
|
338
349
|
* If NodeData.id is set (non-empty), includes it as _id property in the GQL.
|
|
339
350
|
* Returns the raw Response containing the inserted nodes in columns n0, n1, etc.
|
|
351
|
+
*
|
|
352
|
+
* @param nodes Nodes to insert.
|
|
353
|
+
* @param config Optional InsertConfig. Supports per-call graphName and insertType.
|
|
340
354
|
*/
|
|
341
|
-
insertNodes(nodes: NodeData[],
|
|
355
|
+
insertNodes(nodes: NodeData[], config?: InsertConfig): Promise<Response>;
|
|
342
356
|
/**
|
|
343
357
|
* Insert edges using GQL INSERT syntax with RETURN clause.
|
|
344
358
|
* Each edge is inserted individually using MATCH + INSERT to resolve node IDs.
|
|
345
359
|
* GQL: MATCH (src WHERE id(src) = 'from'), (dst WHERE id(dst) = 'to')
|
|
346
360
|
* INSERT (src)-[e0:Label {p1: v1}]->(dst) RETURN e0
|
|
361
|
+
* When config.insertType is InsertType.Overwrite, uses INSERT OVERWRITE syntax.
|
|
347
362
|
* Returns a merged Response containing all inserted edges in columns e0, e1, etc.
|
|
363
|
+
*
|
|
364
|
+
* @param edges Edges to insert.
|
|
365
|
+
* @param config Optional InsertConfig. Supports per-call graphName and insertType.
|
|
348
366
|
*/
|
|
349
|
-
insertEdges(edges: EdgeData[],
|
|
367
|
+
insertEdges(edges: EdgeData[], config?: InsertConfig): Promise<Response>;
|
|
350
368
|
/** Return currently running processes (queries) */
|
|
351
|
-
top(): Promise<ProcessInfo[]>;
|
|
369
|
+
top(config?: QueryConfig): Promise<ProcessInfo[]>;
|
|
352
370
|
/** Terminate a running query by its query ID */
|
|
353
|
-
kill(queryId: string): Promise<Response>;
|
|
371
|
+
kill(queryId: string, config?: QueryConfig): Promise<Response>;
|
|
354
372
|
/** Return statistics for the current graph using db.stats() */
|
|
355
|
-
stats(): Promise<GraphStats>;
|
|
373
|
+
stats(config?: QueryConfig): Promise<GraphStats>;
|
|
356
374
|
/** Send a ping to the server and return the latency in nanoseconds */
|
|
357
375
|
test(): Promise<number>;
|
|
358
376
|
}
|