falkordb 6.2.1 → 6.2.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.
|
@@ -9,9 +9,9 @@ export interface Client {
|
|
|
9
9
|
configGet(configKey: string): Promise<(string | number)[] | (string | number)[][]>;
|
|
10
10
|
configSet(configKey: string, value: number | string): Promise<void>;
|
|
11
11
|
info(section?: string): Promise<(string | string[])[]>;
|
|
12
|
-
query<T>(graph: string, query: RedisCommandArgument, options?: QueryOptions): Promise<any>;
|
|
12
|
+
query<T>(graph: string, query: RedisCommandArgument, options?: QueryOptions, compact?: boolean): Promise<any>;
|
|
13
13
|
profile<T>(graph: string, query: RedisCommandArgument): Promise<any>;
|
|
14
|
-
roQuery<T>(graph: string, query: RedisCommandArgument, options?: QueryOptions): Promise<any>;
|
|
14
|
+
roQuery<T>(graph: string, query: RedisCommandArgument, options?: QueryOptions, compact?: boolean): Promise<any>;
|
|
15
15
|
copy<T>(srcGraph: string, destGraph: string): Promise<any>;
|
|
16
16
|
delete(graph: string): Promise<void>;
|
|
17
17
|
explain(graph: string, query: string): Promise<any>;
|
|
@@ -18,7 +18,7 @@ export declare class Cluster implements Client {
|
|
|
18
18
|
falkordb: typeof commands;
|
|
19
19
|
}, RedisFunctions, RedisScripts>>;
|
|
20
20
|
init(falkordb: FalkorDB): Promise<void>;
|
|
21
|
-
query<T>(graph: string, query: RedisCommandArgument, options?: QueryOptions): Promise<{
|
|
21
|
+
query<T>(graph: string, query: RedisCommandArgument, options?: QueryOptions, compact?: boolean): Promise<{
|
|
22
22
|
headers: undefined;
|
|
23
23
|
data: undefined;
|
|
24
24
|
metadata: string[];
|
|
@@ -27,7 +27,7 @@ export declare class Cluster implements Client {
|
|
|
27
27
|
data: (string | number | (string | number | (string | number | (string | number | (string | number | (string | number | (string | number | (string | number | (string | number | (string | number | (string | number | any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[];
|
|
28
28
|
metadata: string[];
|
|
29
29
|
}>;
|
|
30
|
-
roQuery<T>(graph: string, query: RedisCommandArgument, options?: QueryOptions): Promise<{
|
|
30
|
+
roQuery<T>(graph: string, query: RedisCommandArgument, options?: QueryOptions, compact?: boolean): Promise<{
|
|
31
31
|
headers: undefined;
|
|
32
32
|
data: undefined;
|
|
33
33
|
metadata: string[];
|
|
@@ -29,11 +29,11 @@ class Cluster {
|
|
|
29
29
|
.on('error', err => falkordb.emit('error', err)) // Forward errors
|
|
30
30
|
.connect();
|
|
31
31
|
}
|
|
32
|
-
async query(graph, query, options) {
|
|
33
|
-
return this.#client.falkordb.query(graph, query, options,
|
|
32
|
+
async query(graph, query, options, compact = true) {
|
|
33
|
+
return this.#client.falkordb.query(graph, query, options, compact);
|
|
34
34
|
}
|
|
35
|
-
async roQuery(graph, query, options) {
|
|
36
|
-
return this.#client.falkordb.roQuery(graph, query, options,
|
|
35
|
+
async roQuery(graph, query, options, compact = true) {
|
|
36
|
+
return this.#client.falkordb.roQuery(graph, query, options, compact);
|
|
37
37
|
}
|
|
38
38
|
async delete(graph) {
|
|
39
39
|
const reply = this.#client.falkordb.delete(graph);
|
|
@@ -12,7 +12,7 @@ export declare class Single implements Client {
|
|
|
12
12
|
protected client: SingleGraphConnection;
|
|
13
13
|
constructor(client: SingleGraphConnection);
|
|
14
14
|
init(falkordb: FalkorDB): Promise<void>;
|
|
15
|
-
query<T>(graph: string, query: RedisCommandArgument, options?: QueryOptions): Promise<{
|
|
15
|
+
query<T>(graph: string, query: RedisCommandArgument, options?: QueryOptions, compact?: boolean): Promise<{
|
|
16
16
|
headers: undefined;
|
|
17
17
|
data: undefined;
|
|
18
18
|
metadata: string[];
|
|
@@ -21,7 +21,7 @@ export declare class Single implements Client {
|
|
|
21
21
|
data: (string | number | (string | number | (string | number | (string | number | (string | number | (string | number | (string | number | (string | number | (string | number | (string | number | (string | number | any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[];
|
|
22
22
|
metadata: string[];
|
|
23
23
|
}>;
|
|
24
|
-
roQuery<T>(graph: string, query: RedisCommandArgument, options?: QueryOptions): Promise<{
|
|
24
|
+
roQuery<T>(graph: string, query: RedisCommandArgument, options?: QueryOptions, compact?: boolean): Promise<{
|
|
25
25
|
headers: undefined;
|
|
26
26
|
data: undefined;
|
|
27
27
|
metadata: string[];
|
|
@@ -11,22 +11,22 @@ class Single {
|
|
|
11
11
|
init(falkordb) {
|
|
12
12
|
return Promise.resolve();
|
|
13
13
|
}
|
|
14
|
-
async query(graph, query, options) {
|
|
14
|
+
async query(graph, query, options, compact = true) {
|
|
15
15
|
const reply = this.#usePool ?
|
|
16
16
|
await this.client.executeIsolated(async (isolatedClient) => {
|
|
17
|
-
return isolatedClient.falkordb.query(graph, query, options,
|
|
17
|
+
return isolatedClient.falkordb.query(graph, query, options, compact);
|
|
18
18
|
})
|
|
19
19
|
:
|
|
20
|
-
await this.client.falkordb.query(graph, query, options,
|
|
20
|
+
await this.client.falkordb.query(graph, query, options, compact);
|
|
21
21
|
return reply;
|
|
22
22
|
}
|
|
23
|
-
async roQuery(graph, query, options) {
|
|
23
|
+
async roQuery(graph, query, options, compact = true) {
|
|
24
24
|
const reply = this.#usePool ?
|
|
25
25
|
await this.client.executeIsolated(async (isolatedClient) => {
|
|
26
|
-
return isolatedClient.falkordb.roQuery(graph, query, options,
|
|
26
|
+
return isolatedClient.falkordb.roQuery(graph, query, options, compact);
|
|
27
27
|
})
|
|
28
28
|
:
|
|
29
|
-
await this.client.falkordb.roQuery(graph, query, options,
|
|
29
|
+
await this.client.falkordb.roQuery(graph, query, options, compact);
|
|
30
30
|
return reply;
|
|
31
31
|
}
|
|
32
32
|
async delete(graph) {
|
package/dist/src/graph.js
CHANGED
|
@@ -19,6 +19,7 @@ var GraphValueTypes;
|
|
|
19
19
|
GraphValueTypes[GraphValueTypes["PATH"] = 9] = "PATH";
|
|
20
20
|
GraphValueTypes[GraphValueTypes["MAP"] = 10] = "MAP";
|
|
21
21
|
GraphValueTypes[GraphValueTypes["POINT"] = 11] = "POINT";
|
|
22
|
+
GraphValueTypes[GraphValueTypes["VECTORF32"] = 12] = "VECTORF32";
|
|
22
23
|
})(GraphValueTypes || (GraphValueTypes = {}));
|
|
23
24
|
// export type GraphConnection = SingleGraphConnection | ClusterGraphConnection;
|
|
24
25
|
class Graph {
|
|
@@ -67,9 +68,9 @@ class Graph {
|
|
|
67
68
|
// DO NOT use directly, use #updateMetadata instead
|
|
68
69
|
async #setMetadata() {
|
|
69
70
|
const [labels, relationshipTypes, propertyKeys] = await Promise.all([
|
|
70
|
-
this.#client.roQuery(this.#name, 'CALL db.labels()'),
|
|
71
|
-
this.#client.roQuery(this.#name, 'CALL db.relationshipTypes()'),
|
|
72
|
-
this.#client.roQuery(this.#name, 'CALL db.propertyKeys()')
|
|
71
|
+
this.#client.roQuery(this.#name, 'CALL db.labels()', undefined, false),
|
|
72
|
+
this.#client.roQuery(this.#name, 'CALL db.relationshipTypes()', undefined, false),
|
|
73
|
+
this.#client.roQuery(this.#name, 'CALL db.propertyKeys()', undefined, false)
|
|
73
74
|
]);
|
|
74
75
|
this.#metadata = {
|
|
75
76
|
labels: this.#cleanMetadataArray(labels.data),
|
|
@@ -145,6 +146,8 @@ class Graph {
|
|
|
145
146
|
latitude: parseFloat(value[0]),
|
|
146
147
|
longitude: parseFloat(value[1])
|
|
147
148
|
};
|
|
149
|
+
case GraphValueTypes.VECTORF32:
|
|
150
|
+
return value.map(x => Number(x));
|
|
148
151
|
default:
|
|
149
152
|
throw new Error(`unknown scalar type: ${valueType}`);
|
|
150
153
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "falkordb",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.3",
|
|
4
4
|
"description": "A FalkorDB javascript library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -34,14 +34,16 @@
|
|
|
34
34
|
],
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@tsconfig/node14": "^14.1.0",
|
|
37
|
-
"@types/jest": "^29.5.
|
|
37
|
+
"@types/jest": "^29.5.13",
|
|
38
38
|
"@types/lodash": "^4.17.7",
|
|
39
39
|
"@types/node": "^22.0.0",
|
|
40
40
|
"@typescript-eslint/eslint-plugin": "^7.16.0",
|
|
41
41
|
"@typescript-eslint/parser": "^7.18.0",
|
|
42
42
|
"eslint": "^8.57.0",
|
|
43
43
|
"gh-pages": "^6.0.0",
|
|
44
|
+
"jest": "^29.7.0",
|
|
44
45
|
"release-it": "^17.6.0",
|
|
46
|
+
"ts-jest": "^29.2.5",
|
|
45
47
|
"typescript": "^5.4.2"
|
|
46
48
|
},
|
|
47
49
|
"dependencies": {
|