fix: Prevent server from throwing error on uninitialized database

This commit is contained in:
April Hall 2025-01-08 18:04:56 -05:00
parent 881ddd1648
commit 4cb6674562
Signed by: arithefirst
GPG Key ID: 4508A15C4DB91C5B

View File

@ -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};`);