falkordb 6.6.1 → 6.7.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/README.md +17 -0
- package/dist/src/clients/client.d.ts +8 -0
- package/dist/src/clients/cluster.d.ts +1 -0
- package/dist/src/clients/cluster.js +24 -0
- package/dist/src/clients/nullClient.d.ts +1 -0
- package/dist/src/clients/nullClient.js +3 -0
- package/dist/src/clients/single.d.ts +1 -0
- package/dist/src/clients/single.js +3 -0
- package/dist/src/commands/STUBS.d.ts +5 -0
- package/dist/src/commands/STUBS.js +16 -0
- package/dist/src/commands/index.d.ts +3 -0
- package/dist/src/commands/index.js +3 -0
- package/dist/src/falkordb.d.ts +9 -0
- package/dist/src/falkordb.js +11 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -62,6 +62,23 @@ db.close()
|
|
|
62
62
|
|
|
63
63
|
To learn more about Cypher query language check: https://docs.falkordb.com/cypher/
|
|
64
64
|
|
|
65
|
+
#### `.stubs()`
|
|
66
|
+
|
|
67
|
+
Lists the graphs that are currently offloaded to disk ("stubs"). `db.list()` already includes
|
|
68
|
+
offloaded graphs, so `stubs()` is how you tell which of the listed graphs are not loaded in memory.
|
|
69
|
+
|
|
70
|
+
`GRAPH.STUBS` is provided by the FalkorDB Enterprise graph-offloading module, so on deployments
|
|
71
|
+
without that module the call rejects with an "unknown command" error — treat that as
|
|
72
|
+
"offloading is not supported here".
|
|
73
|
+
|
|
74
|
+
On a cluster the replies of all master nodes are combined. If only some masters fail, the
|
|
75
|
+
partial result is returned and the failures are logged; the call rejects only when every
|
|
76
|
+
master fails.
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
const offloaded = await db.stubs();
|
|
80
|
+
```
|
|
81
|
+
|
|
65
82
|
#### `.close()`
|
|
66
83
|
|
|
67
84
|
Forcibly close a client's connection to FalkorDB immediately. Calling `close` will not send further pending commands to the Redis server, or wait for or parse outstanding responses.
|
|
@@ -8,6 +8,14 @@ import { UdfListReply } from "../commands/UDF_LIST";
|
|
|
8
8
|
export interface Client {
|
|
9
9
|
init(falkordb: FalkorDB): Promise<void>;
|
|
10
10
|
list(): Promise<Array<string>>;
|
|
11
|
+
/**
|
|
12
|
+
* Lists the graphs that are currently offloaded to disk ("stubs").
|
|
13
|
+
*
|
|
14
|
+
* `GRAPH.STUBS` is provided by the FalkorDB Enterprise graph-offloading
|
|
15
|
+
* module, so it rejects with an "unknown command" error on deployments where
|
|
16
|
+
* that module is not loaded.
|
|
17
|
+
*/
|
|
18
|
+
stubs(): Promise<Array<string>>;
|
|
11
19
|
configGet(configKey: string): Promise<(string | number)[] | (string | number)[][]>;
|
|
12
20
|
configSet(configKey: string, value: number | string): Promise<void>;
|
|
13
21
|
info(section?: string): Promise<(string | string[])[]>;
|
|
@@ -41,6 +41,7 @@ export declare class Cluster implements Client {
|
|
|
41
41
|
delete(graph: string): Promise<void>;
|
|
42
42
|
explain(graph: string, query: string): Promise<string[]>;
|
|
43
43
|
list(): Promise<Array<string>>;
|
|
44
|
+
stubs(): Promise<Array<string>>;
|
|
44
45
|
configGet(configKey: string): Promise<(string | number)[] | (string | number)[][]>;
|
|
45
46
|
configSet(configKey: string, value: number | string): Promise<void>;
|
|
46
47
|
info(section?: string): Promise<(string | string[])[]>;
|
|
@@ -59,6 +59,30 @@ class Cluster {
|
|
|
59
59
|
}
|
|
60
60
|
return result;
|
|
61
61
|
}
|
|
62
|
+
async stubs() {
|
|
63
|
+
const replies = await Promise.allSettled(this.#client.masters.map(async (master) => {
|
|
64
|
+
return (await this.#client.nodeClient(master)).falkordb.stubs();
|
|
65
|
+
}));
|
|
66
|
+
const result = [];
|
|
67
|
+
const errors = [];
|
|
68
|
+
for (const reply of replies) {
|
|
69
|
+
if (reply.status === "fulfilled") {
|
|
70
|
+
result.push(...reply.value);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
errors.push(reply.reason);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// Only surface a failure when every master failed - e.g. when the
|
|
77
|
+
// graph-offloading module is missing cluster-wide ("unknown command").
|
|
78
|
+
if (errors.length > 0 && errors.length === replies.length) {
|
|
79
|
+
throw errors[0];
|
|
80
|
+
}
|
|
81
|
+
if (errors.length > 0) {
|
|
82
|
+
console.error("Some nodes failed to respond:", errors);
|
|
83
|
+
}
|
|
84
|
+
return result;
|
|
85
|
+
}
|
|
62
86
|
async configGet(configKey) {
|
|
63
87
|
return this.#client.falkordb.configGet(configKey);
|
|
64
88
|
}
|
|
@@ -21,6 +21,7 @@ export declare class NullClient implements Client {
|
|
|
21
21
|
getConnection(): Promise<SingleGraphConnection>;
|
|
22
22
|
init(_falkordb: FalkorDB): Promise<void>;
|
|
23
23
|
list(): Promise<Array<string>>;
|
|
24
|
+
stubs(): Promise<Array<string>>;
|
|
24
25
|
configGet(_configKey: string): Promise<(string | number)[] | (string | number)[][]>;
|
|
25
26
|
configSet(_configKey: string, _value: number | string): Promise<void>;
|
|
26
27
|
info(_section?: string): Promise<(string | string[])[]>;
|
|
@@ -35,6 +35,7 @@ export declare class Single implements Client {
|
|
|
35
35
|
explain(graph: string, query: string): Promise<string[]>;
|
|
36
36
|
profile<_T>(graph: string, query: string): Promise<string[]>;
|
|
37
37
|
list(): Promise<string[]>;
|
|
38
|
+
stubs(): Promise<string[]>;
|
|
38
39
|
configGet(configKey: string): Promise<(string | number)[] | (string | number)[][]>;
|
|
39
40
|
configSet(configKey: string, value: number | string): Promise<void>;
|
|
40
41
|
info(section?: string): Promise<(string | string[])[]>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CommandParser } from '@redis/client';
|
|
2
|
+
export declare const IS_READ_ONLY = true;
|
|
3
|
+
export declare function parseCommand(parser: CommandParser): void;
|
|
4
|
+
export declare function transformArguments(): Array<string>;
|
|
5
|
+
export declare function transformReply(reply: unknown): Array<string>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IS_READ_ONLY = void 0;
|
|
4
|
+
exports.parseCommand = parseCommand;
|
|
5
|
+
exports.transformArguments = transformArguments;
|
|
6
|
+
exports.transformReply = transformReply;
|
|
7
|
+
exports.IS_READ_ONLY = true;
|
|
8
|
+
function parseCommand(parser) {
|
|
9
|
+
parser.push('GRAPH.STUBS');
|
|
10
|
+
}
|
|
11
|
+
function transformArguments() {
|
|
12
|
+
return ['GRAPH.STUBS'];
|
|
13
|
+
}
|
|
14
|
+
function transformReply(reply) {
|
|
15
|
+
return reply;
|
|
16
|
+
}
|
|
@@ -8,6 +8,7 @@ import * as PROFILE from './PROFILE';
|
|
|
8
8
|
import * as QUERY from './QUERY';
|
|
9
9
|
import * as RO_QUERY from './RO_QUERY';
|
|
10
10
|
import * as SLOWLOG from './SLOWLOG';
|
|
11
|
+
import * as STUBS from './STUBS';
|
|
11
12
|
import * as CONSTRAINT_CREATE from './CONSTRAINT_CREATE';
|
|
12
13
|
import * as CONSTRAINT_DROP from './CONSTRAINT_DROP';
|
|
13
14
|
import * as COPY from './COPY';
|
|
@@ -40,6 +41,8 @@ declare const _default: {
|
|
|
40
41
|
roQuery: typeof RO_QUERY;
|
|
41
42
|
SLOWLOG: typeof SLOWLOG;
|
|
42
43
|
slowLog: typeof SLOWLOG;
|
|
44
|
+
STUBS: typeof STUBS;
|
|
45
|
+
stubs: typeof STUBS;
|
|
43
46
|
CONSTRAINT_CREATE: typeof CONSTRAINT_CREATE;
|
|
44
47
|
constraintCreate: typeof CONSTRAINT_CREATE;
|
|
45
48
|
CONSTRAINT_DROP: typeof CONSTRAINT_DROP;
|
|
@@ -11,6 +11,7 @@ const PROFILE = require("./PROFILE");
|
|
|
11
11
|
const QUERY = require("./QUERY");
|
|
12
12
|
const RO_QUERY = require("./RO_QUERY");
|
|
13
13
|
const SLOWLOG = require("./SLOWLOG");
|
|
14
|
+
const STUBS = require("./STUBS");
|
|
14
15
|
const CONSTRAINT_CREATE = require("./CONSTRAINT_CREATE");
|
|
15
16
|
const CONSTRAINT_DROP = require("./CONSTRAINT_DROP");
|
|
16
17
|
const COPY = require("./COPY");
|
|
@@ -42,6 +43,8 @@ exports.default = {
|
|
|
42
43
|
roQuery: RO_QUERY,
|
|
43
44
|
SLOWLOG,
|
|
44
45
|
slowLog: SLOWLOG,
|
|
46
|
+
STUBS,
|
|
47
|
+
stubs: STUBS,
|
|
45
48
|
CONSTRAINT_CREATE,
|
|
46
49
|
constraintCreate: CONSTRAINT_CREATE,
|
|
47
50
|
CONSTRAINT_DROP,
|
package/dist/src/falkordb.d.ts
CHANGED
|
@@ -82,6 +82,15 @@ export default class FalkorDB extends EventEmitter {
|
|
|
82
82
|
selectGraph(graphId: string): Graph;
|
|
83
83
|
get connection(): Promise<SingleGraphConnection>;
|
|
84
84
|
list(): Promise<string[]>;
|
|
85
|
+
/**
|
|
86
|
+
* Lists the graphs that are currently offloaded to disk ("stubs").
|
|
87
|
+
*
|
|
88
|
+
* `GRAPH.STUBS` is provided by the FalkorDB Enterprise graph-offloading
|
|
89
|
+
* module, so this rejects with an "unknown command" error on deployments
|
|
90
|
+
* where that module is not loaded. Callers that support both editions
|
|
91
|
+
* should treat such a rejection as "no offloading support".
|
|
92
|
+
*/
|
|
93
|
+
stubs(): Promise<string[]>;
|
|
85
94
|
configGet(configKey: string): Promise<(string | number)[] | (string | number)[][]>;
|
|
86
95
|
configSet(configKey: string, value: number | string): Promise<void>;
|
|
87
96
|
info(section?: string): Promise<(string | string[])[]>;
|
package/dist/src/falkordb.js
CHANGED
|
@@ -53,6 +53,17 @@ class FalkorDB extends events_1.EventEmitter {
|
|
|
53
53
|
async list() {
|
|
54
54
|
return this.#client.list();
|
|
55
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Lists the graphs that are currently offloaded to disk ("stubs").
|
|
58
|
+
*
|
|
59
|
+
* `GRAPH.STUBS` is provided by the FalkorDB Enterprise graph-offloading
|
|
60
|
+
* module, so this rejects with an "unknown command" error on deployments
|
|
61
|
+
* where that module is not loaded. Callers that support both editions
|
|
62
|
+
* should treat such a rejection as "no offloading support".
|
|
63
|
+
*/
|
|
64
|
+
async stubs() {
|
|
65
|
+
return this.#client.stubs();
|
|
66
|
+
}
|
|
56
67
|
async configGet(configKey) {
|
|
57
68
|
return this.#client.configGet(configKey);
|
|
58
69
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "falkordb",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.7.0",
|
|
4
4
|
"description": "A FalkorDB javascript library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -33,16 +33,16 @@
|
|
|
33
33
|
"falkordb"
|
|
34
34
|
],
|
|
35
35
|
"engines": {
|
|
36
|
-
"node": ">=
|
|
36
|
+
"node": ">=22"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@tsconfig/node20": "^20.1.4",
|
|
40
|
-
"@types/jest": "^
|
|
40
|
+
"@types/jest": "^30.0.0",
|
|
41
41
|
"@types/lodash": "^4.17.13",
|
|
42
42
|
"@types/node": "^25.0.2",
|
|
43
43
|
"@typescript-eslint/eslint-plugin": "^8.18.2",
|
|
44
44
|
"@typescript-eslint/parser": "^8.18.2",
|
|
45
|
-
"eslint": "^
|
|
45
|
+
"eslint": "^10.0.1",
|
|
46
46
|
"gh-pages": "^6.2.0",
|
|
47
47
|
"jest": "^30.2.0",
|
|
48
48
|
"release-it": "^19.0.3",
|