Skip to content

Commit

Permalink
Merge pull request #131 from FalkorDB/add-cluster
Browse files Browse the repository at this point in the history
Add support for FalkorDB Cluster
  • Loading branch information
gkorland authored Sep 10, 2024
2 parents 2058b0a + 560e0e1 commit d71afff
Show file tree
Hide file tree
Showing 12 changed files with 591 additions and 245 deletions.
115 changes: 63 additions & 52 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"devDependencies": {
"@tsconfig/node14": "^14.1.0",
"@types/jest": "^29.5.12",
"@types/lodash": "^4.17.7",
"@types/node": "^22.0.0",
"@typescript-eslint/eslint-plugin": "^7.16.0",
"@typescript-eslint/parser": "^7.18.0",
Expand All @@ -45,7 +46,9 @@
},
"dependencies": {
"@redis/client": "^1.6.0",
"cluster-key-slot": "1.1.2",
"generic-pool": "^3.9.0",
"lodash": "^4.17.21",
"redis": "^4.7.0"
}
}
36 changes: 36 additions & 0 deletions src/clients/client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { RedisCommandArgument } from "@redis/client/dist/lib/commands"
import { QueryOptions } from "../commands"
import { ConstraintType, EntityType, GraphReply } from "../graph"
import FalkorDB from "../falkordb"

// A generic client interface for Redis clients
export interface Client {

init(falkordb: FalkorDB): Promise<void>

list(): Promise<Array<string>>
configGet(configKey: string): Promise<(string | number)[] | (string | number)[][]>
configSet(configKey: string, value: number | string): Promise<void>
info(section?: string): Promise<(string | string[])[]>
query<T>(graph: string, query: RedisCommandArgument,options?: QueryOptions): Promise<any>
profile<T>(graph: string, query: RedisCommandArgument): Promise<any>
roQuery<T>(graph: string, query: RedisCommandArgument, options?: QueryOptions): Promise<any>
copy<T>(srcGraph: string, destGraph: string): Promise<any>
delete(graph: string): Promise<void>
explain(graph: string, query: string): Promise<any>

slowLog(graph: string) : Promise<{
timestamp: Date;
command: string;
query: string;
took: number;
}[]>

constraintCreate(graph: string, constraintType: ConstraintType, entityType: EntityType,
label: string, ...properties: string[]) : Promise<void>

constraintDrop(graph: string, constraintType: ConstraintType, entityType: EntityType,
label: string, ...properties: string[]) : Promise<void>

quit(): Promise<void>
}
Loading

0 comments on commit d71afff

Please sign in to comment.