-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from FalkorDB/sentinel
fix #38 Auto discover masters when using sentinel
- Loading branch information
Showing
5 changed files
with
123 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { FalkorDB } from 'falkordb'; | ||
|
||
const db = await FalkorDB.connect({ | ||
// username: 'myUsername', | ||
// password: 'myPassword', | ||
socket: { | ||
host: 'localhost', | ||
port: 26379 | ||
} | ||
}) | ||
db.on('error', console.error) | ||
|
||
console.log('Connected to FalkorDB') | ||
|
||
const graph = db.selectGraph('myGraph') | ||
const result = await graph.query('MATCH (n) RETURN n') | ||
|
||
console.log(result) | ||
|
||
console.log(await db.list()) | ||
console.log(await db.info()) | ||
console.log(await db.connection.info()) | ||
|
||
db.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export const IS_READ_ONLY = true; | ||
|
||
export function transformArguments(dbname: string): Array<string> { | ||
return ['SENTINEL', 'MASTER', dbname]; | ||
} | ||
|
||
export declare function transformReply(): Array<string>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export const IS_READ_ONLY = true; | ||
|
||
export function transformArguments(): Array<string> { | ||
return ['SENTINEL', 'MASTERS']; | ||
} | ||
|
||
export declare function transformReply(): Array<Array<string>>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters