Skip to content

Commit

Permalink
add cassandra client
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthvp committed Jul 9, 2023
1 parent 56b34ef commit 131e587
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 41 deletions.
16 changes: 16 additions & 0 deletions cassandra.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {Client, DseClientOptions} from 'cassandra-driver';
import {AuthManager} from "./botbase";
import {mapPath} from "./utils";

export class Cassandra extends Client {
constructor(keyspace: string = 'toolforge', conf: DseClientOptions = {}) {
super({
cloud: {
secureConnectBundle: mapPath('~/secure-connect-astra-db-1001.zip')
},
credentials: AuthManager.get('cassandra-astra-db-1001'),
keyspace: keyspace,
...conf
});
}
}
151 changes: 110 additions & 41 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@types/nodemailer": "^6.4.7",
"@types/object-hash": "^1.3.4",
"async-redis": "^1.1.7",
"cassandra-driver": "^4.6.4",
"eventsource": "^1.0.7",
"express": "^4.17.1",
"jsdom": "^16.2.1",
Expand Down

0 comments on commit 131e587

Please sign in to comment.