fix: Prevent server from throwing error on uninitialized database
This commit is contained in:
parent
881ddd1648
commit
4cb6674562
@ -3,11 +3,10 @@ import cassandra from 'cassandra-driver';
|
||||
const client = new cassandra.Client({
|
||||
contactPoints: ['localhost'],
|
||||
localDataCenter: 'datacenter1',
|
||||
keyspace: 'users',
|
||||
});
|
||||
|
||||
// Connect to Cassandra/ScyllaDB and create
|
||||
// necessary tables, keyspaces, etc
|
||||
// the necessary tables, keyspaces, etc.
|
||||
await client.connect();
|
||||
await client.execute(`CREATE KEYSPACE IF NOT EXISTS users WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_factor': 1};`);
|
||||
await client.execute(`CREATE KEYSPACE IF NOT EXISTS channels WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_factor': 1};`);
|
||||
|
Loading…
Reference in New Issue
Block a user