falkordb 6.9.2 → 6.9.3
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/README.md +56 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +11 -1
- package/dist/src/clients/client.d.ts +23 -5
- package/dist/src/clients/client.js +7 -0
- package/dist/src/clients/cluster.d.ts +16 -6
- package/dist/src/clients/cluster.js +41 -16
- package/dist/src/clients/nullClient.d.ts +4 -3
- package/dist/src/clients/nullClient.js +5 -2
- package/dist/src/clients/single.d.ts +6 -5
- package/dist/src/clients/single.js +17 -8
- package/dist/src/commands/CONSTRAINT_CREATE.js +3 -1
- package/dist/src/commands/CONSTRAINT_DROP.js +3 -1
- package/dist/src/commands/COPY.js +3 -1
- package/dist/src/commands/EXPLAIN.d.ts +3 -2
- package/dist/src/commands/EXPLAIN.js +5 -4
- package/dist/src/commands/MEMORY_USAGE.js +7 -4
- package/dist/src/commands/PROFILE.d.ts +4 -3
- package/dist/src/commands/PROFILE.js +7 -5
- package/dist/src/commands/QUERY.js +7 -2
- package/dist/src/commands/RO_QUERY.js +5 -1
- package/dist/src/commands/SLOWLOG.d.ts +1 -1
- package/dist/src/commands/SLOWLOG.js +3 -1
- package/dist/src/commands/SLOWLOG_RESET.d.ts +5 -0
- package/dist/src/commands/SLOWLOG_RESET.js +19 -0
- package/dist/src/commands/index.d.ts +10 -1
- package/dist/src/commands/index.js +60 -12
- package/dist/src/entities.d.ts +19 -0
- package/dist/src/entities.js +121 -0
- package/dist/src/execution-plan.d.ts +45 -0
- package/dist/src/execution-plan.js +121 -0
- package/dist/src/falkordb.js +31 -4
- package/dist/src/graph.d.ts +95 -18
- package/dist/src/graph.js +321 -75
- package/dist/src/query-statistics.d.ts +6 -0
- package/dist/src/query-statistics.js +66 -0
- package/dist/src/types/falkordb-options.d.ts +8 -0
- package/dist/src/types/graph-value.d.ts +11 -5
- package/dist/src/types/index.d.ts +2 -0
- package/dist/src/types/index.js +2 -0
- package/dist/src/types/procedures.d.ts +47 -0
- package/dist/src/types/procedures.js +2 -0
- package/dist/src/types/query-options.d.ts +6 -1
- package/dist/src/types/query-statistics.d.ts +20 -0
- package/dist/src/types/query-statistics.js +2 -0
- package/package.json +1 -1
package/dist/src/graph.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { RedisArgument } from "@redis/client";
|
|
2
2
|
import { Client } from "./clients/client";
|
|
3
3
|
import { ConstraintType, EntityType } from "./enums";
|
|
4
|
-
import
|
|
4
|
+
import { ExecutionPlan } from "./execution-plan";
|
|
5
|
+
import type { CallProcedureOptions, ConstraintInfo, GraphReply, IndexInfo, MemoryUsageOptions, PlanOptions, QueryOptions, QueryParam, VectorIndexOptions } from "./types";
|
|
5
6
|
export { ConstraintType, EntityType };
|
|
6
7
|
export type { GraphReply };
|
|
7
8
|
/**
|
|
@@ -16,10 +17,14 @@ export interface GraphSchemaState {
|
|
|
16
17
|
export interface GraphCacheOptions {
|
|
17
18
|
schema?: GraphSchemaState;
|
|
18
19
|
onDelete?: (graph: Graph) => void;
|
|
20
|
+
selectGraph?: (name: string) => Graph;
|
|
21
|
+
integers?: "number" | "bigint";
|
|
19
22
|
}
|
|
20
23
|
export default class Graph {
|
|
21
24
|
#private;
|
|
22
25
|
constructor(client: Client, name: string, cache?: GraphCacheOptions);
|
|
26
|
+
/** The graph's name (its Redis key) */
|
|
27
|
+
get name(): string;
|
|
23
28
|
query<T>(query: RedisArgument, options?: QueryOptions): Promise<GraphReply<T>>;
|
|
24
29
|
roQuery<T>(query: RedisArgument, options?: QueryOptions): Promise<GraphReply<T>>;
|
|
25
30
|
delete(): Promise<void>;
|
|
@@ -31,26 +36,98 @@ export default class Graph {
|
|
|
31
36
|
* on the next query, so this is rarely needed.
|
|
32
37
|
*/
|
|
33
38
|
clearMetadataCache(): void;
|
|
34
|
-
|
|
35
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Returns the query's execution plan as an operation tree, without running
|
|
41
|
+
* the query. The lines the server returned are kept in `steps`.
|
|
42
|
+
*/
|
|
43
|
+
explain(query: string, options?: PlanOptions): Promise<ExecutionPlan>;
|
|
44
|
+
/**
|
|
45
|
+
* Runs the query and returns its execution plan as an operation tree, each
|
|
46
|
+
* operation annotated with its `recordsProduced` and `executionTime`. The
|
|
47
|
+
* lines the server returned are kept in `steps`.
|
|
48
|
+
*/
|
|
49
|
+
profile(query: string, options?: PlanOptions): Promise<ExecutionPlan>;
|
|
36
50
|
memoryUsage(options?: MemoryUsageOptions): Promise<import("./types").MemoryUsageReply>;
|
|
37
51
|
slowLog(): Promise<import("./types").SlowLogReply>;
|
|
52
|
+
/** Clears the graph's slow log (`GRAPH.SLOWLOG <graph> RESET`) */
|
|
53
|
+
slowLogReset(): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Calls a procedure, e.g. `callProcedure('db.idx.fulltext.queryNodes', ['Movie', 'Jungle'])`.
|
|
56
|
+
* The arguments are sent as query parameters, so they need no escaping.
|
|
57
|
+
* Runs as a read-only query unless `readOnly` is `false`.
|
|
58
|
+
*/
|
|
59
|
+
callProcedure<T>(procedure: string, args?: QueryParam[], options?: CallProcedureOptions): Promise<GraphReply<T>>;
|
|
60
|
+
/** Lists the graph's indexes (`CALL db.indexes()`) */
|
|
61
|
+
listIndices(): Promise<IndexInfo[]>;
|
|
62
|
+
/** Lists the graph's constraints and their status (`CALL db.constraints()`) */
|
|
63
|
+
listConstraints(): Promise<ConstraintInfo[]>;
|
|
64
|
+
/**
|
|
65
|
+
* Creates a constraint (`GRAPH.CONSTRAINT CREATE`).
|
|
66
|
+
*
|
|
67
|
+
* A unique constraint requires a range index on each of its properties, so
|
|
68
|
+
* for `ConstraintType.UNIQUE` this first creates that index on every
|
|
69
|
+
* property that is not indexed yet (an existing index is reused). Mandatory
|
|
70
|
+
* constraints need no index and create none.
|
|
71
|
+
*
|
|
72
|
+
* The constraint is enforced asynchronously: the server accepts it before
|
|
73
|
+
* checking the existing data, so poll `listConstraints()` until its status
|
|
74
|
+
* is `OPERATIONAL` (or `FAILED` if existing entities violate it).
|
|
75
|
+
*/
|
|
38
76
|
constraintCreate(constraintType: ConstraintType, entityType: EntityType, label: string, ...properties: string[]): Promise<void>;
|
|
39
77
|
constraintDrop(constraintType: ConstraintType, entityType: EntityType, label: string, ...properties: string[]): Promise<void>;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
78
|
+
/**
|
|
79
|
+
* Creates a unique constraint on nodes, together with the range index it
|
|
80
|
+
* requires on each property. Enforced asynchronously, see `constraintCreate`.
|
|
81
|
+
*/
|
|
82
|
+
createNodeUniqueConstraint(label: string, ...properties: string[]): Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Creates a unique constraint on relationships, together with the range
|
|
85
|
+
* index it requires on each property. Enforced asynchronously, see
|
|
86
|
+
* `constraintCreate`.
|
|
87
|
+
*/
|
|
88
|
+
createEdgeUniqueConstraint(relation: string, ...properties: string[]): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* Creates a mandatory constraint on nodes. Enforced asynchronously, see
|
|
91
|
+
* `constraintCreate`.
|
|
92
|
+
*/
|
|
93
|
+
createNodeMandatoryConstraint(label: string, ...properties: string[]): Promise<void>;
|
|
94
|
+
/**
|
|
95
|
+
* Creates a mandatory constraint on relationships. Enforced asynchronously,
|
|
96
|
+
* see `constraintCreate`.
|
|
97
|
+
*/
|
|
98
|
+
createEdgeMandatoryConstraint(relation: string, ...properties: string[]): Promise<void>;
|
|
99
|
+
/** Drops a unique constraint on nodes; its supporting range index is kept */
|
|
100
|
+
dropNodeUniqueConstraint(label: string, ...properties: string[]): Promise<void>;
|
|
101
|
+
/** Drops a unique constraint on relationships; its supporting range index is kept */
|
|
102
|
+
dropEdgeUniqueConstraint(relation: string, ...properties: string[]): Promise<void>;
|
|
103
|
+
dropNodeMandatoryConstraint(label: string, ...properties: string[]): Promise<void>;
|
|
104
|
+
dropEdgeMandatoryConstraint(relation: string, ...properties: string[]): Promise<void>;
|
|
105
|
+
/**
|
|
106
|
+
* Copies the graph to `destGraph` (`GRAPH.COPY`) and returns the copy: for
|
|
107
|
+
* a graph from `selectGraph`, the instance `selectGraph(destGraph)` returns.
|
|
108
|
+
*/
|
|
109
|
+
copy(destGraph: string): Promise<Graph>;
|
|
110
|
+
createTypedIndex(idxType: string, entityType: "NODE" | "EDGE", label: string, properties: string[], options?: Record<string, string | number | boolean>): Promise<GraphReply<never>>;
|
|
111
|
+
createNodeRangeIndex(label: string, ...properties: string[]): Promise<GraphReply<never>>;
|
|
112
|
+
createNodeFulltextIndex(label: string, ...properties: string[]): Promise<GraphReply<never>>;
|
|
113
|
+
/**
|
|
114
|
+
* Creates a vector index, e.g.
|
|
115
|
+
* `createNodeVectorIndex(label, { dimension: 768, similarityFunction: 'cosine' }, 'embedding')`.
|
|
116
|
+
*/
|
|
117
|
+
createNodeVectorIndex(label: string, options: VectorIndexOptions, ...properties: string[]): Promise<GraphReply<never>>;
|
|
118
|
+
createEdgeRangeIndex(label: string, ...properties: string[]): Promise<GraphReply<never>>;
|
|
119
|
+
createEdgeFulltextIndex(label: string, ...properties: string[]): Promise<GraphReply<never>>;
|
|
120
|
+
/**
|
|
121
|
+
* Creates a vector index, e.g.
|
|
122
|
+
* `createEdgeVectorIndex(label, { dimension: 768, similarityFunction: 'cosine' }, 'embedding')`.
|
|
123
|
+
*/
|
|
124
|
+
createEdgeVectorIndex(label: string, options: VectorIndexOptions, ...properties: string[]): Promise<GraphReply<never>>;
|
|
125
|
+
dropTypedIndex(idxType: string, entityType: "NODE" | "EDGE", label: string, attribute: string): Promise<GraphReply<never>>;
|
|
126
|
+
dropNodeRangeIndex(label: string, attribute: string): Promise<GraphReply<never>>;
|
|
127
|
+
dropNodeFulltextIndex(label: string, attribute: string): Promise<GraphReply<never>>;
|
|
128
|
+
dropNodeVectorIndex(label: string, attribute: string): Promise<GraphReply<never>>;
|
|
129
|
+
dropEdgeRangeIndex(label: string, attribute: string): Promise<GraphReply<never>>;
|
|
130
|
+
dropEdgeFulltextIndex(label: string, attribute: string): Promise<GraphReply<never>>;
|
|
131
|
+
dropEdgeVectorIndex(label: string, attribute: string): Promise<GraphReply<never>>;
|
|
55
132
|
}
|
|
56
133
|
export { Graph };
|