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
|
@@ -18,6 +18,14 @@ export interface FalkorDBOptions {
|
|
|
18
18
|
* Ignored when `url` or `socket.port` is provided.
|
|
19
19
|
*/
|
|
20
20
|
port?: number;
|
|
21
|
+
/**
|
|
22
|
+
* How integers in query results are returned. `'number'` rounds those
|
|
23
|
+
* beyond `Number.MAX_SAFE_INTEGER` (2^53 - 1); `'bigint'` returns every
|
|
24
|
+
* integer value exactly, as a `bigint`. Node and edge ids stay numbers.
|
|
25
|
+
* Note that `JSON.stringify` throws on a `bigint`.
|
|
26
|
+
* @default 'number'
|
|
27
|
+
*/
|
|
28
|
+
integers?: 'number' | 'bigint';
|
|
21
29
|
/**
|
|
22
30
|
* Sentinel only. Resend write commands to the new master when the
|
|
23
31
|
* connection is lost while waiting for their reply, e.g. during a master
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Temporal } from '@js-temporal/polyfill';
|
|
2
|
-
import type {
|
|
2
|
+
import type { QueryStatistics } from './query-statistics';
|
|
3
3
|
export type GraphEntityProperties = Record<string, GraphValue>;
|
|
4
4
|
export interface GraphEdge {
|
|
5
5
|
id: number;
|
|
@@ -20,10 +20,16 @@ export interface GraphPath {
|
|
|
20
20
|
export type GraphMap = {
|
|
21
21
|
[key: string]: GraphValue;
|
|
22
22
|
};
|
|
23
|
-
export type GraphValue = null | string | number | boolean | Array<GraphValue> | GraphEdge | GraphNode | GraphPath | GraphMap | {
|
|
24
|
-
latitude:
|
|
25
|
-
longitude:
|
|
23
|
+
export type GraphValue = null | string | number | bigint | boolean | Array<GraphValue> | GraphEdge | GraphNode | GraphPath | GraphMap | {
|
|
24
|
+
latitude: number;
|
|
25
|
+
longitude: number;
|
|
26
26
|
} | number[] | Temporal.PlainDateTime | Temporal.PlainDate | Temporal.PlainTime | Temporal.Duration;
|
|
27
|
-
|
|
27
|
+
/**
|
|
28
|
+
* The reply to a graph query: the returned columns and rows, if any, and the
|
|
29
|
+
* statistics the server reported for it.
|
|
30
|
+
*/
|
|
31
|
+
export type GraphReply<T> = {
|
|
32
|
+
headers?: Array<string>;
|
|
28
33
|
data?: Array<T>;
|
|
34
|
+
stats: QueryStatistics;
|
|
29
35
|
};
|
|
@@ -8,9 +8,11 @@ export * from './memory-usage';
|
|
|
8
8
|
export * from './net-socket-options';
|
|
9
9
|
export * from './query-options';
|
|
10
10
|
export * from './query-reply';
|
|
11
|
+
export * from './query-statistics';
|
|
11
12
|
export * from './single-graph-connection';
|
|
12
13
|
export * from './slow-log';
|
|
13
14
|
export * from './socket-options';
|
|
14
15
|
export * from './tls-socket-options';
|
|
15
16
|
export * from './typed-redis-client-options';
|
|
16
17
|
export * from './udf-list';
|
|
18
|
+
export * from './procedures';
|
package/dist/src/types/index.js
CHANGED
|
@@ -24,9 +24,11 @@ __exportStar(require("./memory-usage"), exports);
|
|
|
24
24
|
__exportStar(require("./net-socket-options"), exports);
|
|
25
25
|
__exportStar(require("./query-options"), exports);
|
|
26
26
|
__exportStar(require("./query-reply"), exports);
|
|
27
|
+
__exportStar(require("./query-statistics"), exports);
|
|
27
28
|
__exportStar(require("./single-graph-connection"), exports);
|
|
28
29
|
__exportStar(require("./slow-log"), exports);
|
|
29
30
|
__exportStar(require("./socket-options"), exports);
|
|
30
31
|
__exportStar(require("./tls-socket-options"), exports);
|
|
31
32
|
__exportStar(require("./typed-redis-client-options"), exports);
|
|
32
33
|
__exportStar(require("./udf-list"), exports);
|
|
34
|
+
__exportStar(require("./procedures"), exports);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { GraphMap } from './graph-value';
|
|
2
|
+
/** A row of `CALL db.indexes()`, one per indexed label or relationship type */
|
|
3
|
+
export interface IndexInfo {
|
|
4
|
+
label: string;
|
|
5
|
+
properties: string[];
|
|
6
|
+
/** Index types of each property, e.g. `{ name: ['RANGE', 'FULLTEXT'] }` */
|
|
7
|
+
types: Record<string, string[]>;
|
|
8
|
+
/** Options of each property's index, e.g. a vector index's `dimension` */
|
|
9
|
+
options: Record<string, GraphMap>;
|
|
10
|
+
language: string;
|
|
11
|
+
stopwords: string[];
|
|
12
|
+
/** `'NODE'` or `'RELATIONSHIP'` (the server's `entitytype` column) */
|
|
13
|
+
entityType: string;
|
|
14
|
+
/** `'OPERATIONAL'` once built, otherwise a progress message ending in `UNDER CONSTRUCTION` */
|
|
15
|
+
status: string;
|
|
16
|
+
info: GraphMap;
|
|
17
|
+
}
|
|
18
|
+
/** A row of `CALL db.constraints()` */
|
|
19
|
+
export interface ConstraintInfo {
|
|
20
|
+
type: 'UNIQUE' | 'MANDATORY';
|
|
21
|
+
label: string;
|
|
22
|
+
properties: string[];
|
|
23
|
+
/** The server's `entitytype` column */
|
|
24
|
+
entityType: 'NODE' | 'RELATIONSHIP';
|
|
25
|
+
/** `'UNDER CONSTRUCTION'` while existing data is validated, then `'OPERATIONAL'` or `'FAILED'` */
|
|
26
|
+
status: 'UNDER CONSTRUCTION' | 'OPERATIONAL' | 'FAILED';
|
|
27
|
+
}
|
|
28
|
+
/** Options of a vector index, see https://docs.falkordb.com/cypher/indexing/vector-index */
|
|
29
|
+
export interface VectorIndexOptions {
|
|
30
|
+
/** Length of the indexed vectors */
|
|
31
|
+
dimension: number;
|
|
32
|
+
/** Defaults to `'euclidean'` */
|
|
33
|
+
similarityFunction?: 'euclidean' | 'cosine';
|
|
34
|
+
/** Maximum number of outgoing edges per node in the HNSW graph (server default 16) */
|
|
35
|
+
M?: number;
|
|
36
|
+
/** Number of candidates considered while building the index (server default 200) */
|
|
37
|
+
efConstruction?: number;
|
|
38
|
+
/** Number of candidates considered while searching (server default 10) */
|
|
39
|
+
efRuntime?: number;
|
|
40
|
+
}
|
|
41
|
+
export interface CallProcedureOptions {
|
|
42
|
+
/** Columns to `YIELD`; all of the procedure's columns when omitted */
|
|
43
|
+
yields?: string[];
|
|
44
|
+
/** Run with `GRAPH.RO_QUERY` (default) instead of `GRAPH.QUERY` */
|
|
45
|
+
readOnly?: boolean;
|
|
46
|
+
timeout?: number;
|
|
47
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export type QueryParamTypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array;
|
|
2
|
+
export type QueryParam = null | string | number | bigint | boolean | QueryParams | Array<QueryParam> | QueryParamTypedArray;
|
|
2
3
|
export type QueryParams = {
|
|
3
4
|
[key: string]: QueryParam;
|
|
4
5
|
};
|
|
@@ -7,3 +8,7 @@ export interface QueryOptions {
|
|
|
7
8
|
TIMEOUT?: number;
|
|
8
9
|
}
|
|
9
10
|
export type QueryOptionsBackwardCompatible = QueryOptions | number;
|
|
11
|
+
/** Options for `GRAPH.EXPLAIN` and `GRAPH.PROFILE` */
|
|
12
|
+
export interface PlanOptions {
|
|
13
|
+
params?: QueryParams;
|
|
14
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Statistics the server reports for a query, parsed from the statistic lines
|
|
3
|
+
* it sends with every reply. A counter the server did not report is 0.
|
|
4
|
+
*/
|
|
5
|
+
export interface QueryStatistics {
|
|
6
|
+
labelsAdded: number;
|
|
7
|
+
labelsRemoved: number;
|
|
8
|
+
nodesCreated: number;
|
|
9
|
+
nodesDeleted: number;
|
|
10
|
+
propertiesSet: number;
|
|
11
|
+
propertiesRemoved: number;
|
|
12
|
+
relationshipsCreated: number;
|
|
13
|
+
relationshipsDeleted: number;
|
|
14
|
+
indicesCreated: number;
|
|
15
|
+
indicesDeleted: number;
|
|
16
|
+
constraintsCreated: number;
|
|
17
|
+
constraintsDeleted: number;
|
|
18
|
+
cachedExecution: boolean;
|
|
19
|
+
queryInternalExecutionTime: number;
|
|
20
|
+
}
|