style: Prettier format

This commit is contained in:
April Hall 2025-01-09 10:18:43 -05:00
parent b924590746
commit 7849dd0e4a
No known key found for this signature in database
GPG Key ID: A49AC35CB186266C

View File

@ -7,18 +7,13 @@ async function createChannel(client: cassandra.Client, channelName: string) {
message_content TEXT, message_content TEXT,
timestamp TIMESTAMP, timestamp TIMESTAMP,
sender UUID sender UUID
);`) );`);
} }
async function storeMessage( async function storeMessage(client: cassandra.Client, channelName: string, content: string, sender: string, id: string) {
client: cassandra.Client,
channelName: string,
content: string,
sender: string,
id: string) {
const now = new Date(); const now = new Date();
await client.execute(`INSERT INTO channels.channel_${channelName} (id, message_content, timestamp, sender) await client.execute(`INSERT INTO channels.channel_${channelName} (id, message_content, timestamp, sender)
VALUES (${id}, '${content}', ${now.getTime()}, ${sender})`) VALUES (${id}, '${content}', ${now.getTime()}, ${sender})`);
} }
const client = new cassandra.Client({ const client = new cassandra.Client({
@ -32,4 +27,4 @@ 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 users WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_factor': 1};`);
await client.execute(`CREATE KEYSPACE IF NOT EXISTS channels WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_factor': 1};`); await client.execute(`CREATE KEYSPACE IF NOT EXISTS channels WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_factor': 1};`);
export { client, createChannel, storeMessage }; export { client, createChannel, storeMessage };