File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { Cluster } from "../index.js"
2
+
3
+ const nodes = process . env . CLUSTER_NODES ?. split ( "," ) ?? [ "127.0.0.1:9042" ] ;
4
+
5
+ const cluster = new Cluster ( {
6
+ nodes,
7
+ auth : {
8
+ username : "cassandra" ,
9
+ password : "cassandra"
10
+ }
11
+ } ) ;
12
+
13
+ const session = await cluster . connect ( ) ;
14
+
15
+ await session . execute ( "CREATE KEYSPACE IF NOT EXISTS examples_ks WITH REPLICATION = {'class' : 'NetworkTopologyStrategy', 'replication_factor' : 1}" ) ;
16
+ await session . execute ( "DROP TABLE IF EXISTS examples_ks.auth" ) ;
17
+
18
+ console . log ( "Ok." ) ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "extends" : " ../tsconfig.json" ,
3
+ "compilerOptions" : {
4
+ "module" : " ESNext" ,
5
+ "target" : " ESNext" ,
6
+ "moduleResolution" : " NodeNext"
7
+ }
8
+ }
You can’t perform that action at this time.
0 commit comments