style: Prettier format
This commit is contained in:
parent
b924590746
commit
7849dd0e4a
@ -7,18 +7,13 @@ async function createChannel(client: cassandra.Client, channelName: string) {
|
||||
message_content TEXT,
|
||||
timestamp TIMESTAMP,
|
||||
sender UUID
|
||||
);`)
|
||||
);`);
|
||||
}
|
||||
|
||||
async function storeMessage(
|
||||
client: cassandra.Client,
|
||||
channelName: string,
|
||||
content: string,
|
||||
sender: string,
|
||||
id: string) {
|
||||
async function storeMessage(client: cassandra.Client, channelName: string, content: string, sender: string, id: string) {
|
||||
const now = new Date();
|
||||
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({
|
||||
@ -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 channels WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_factor': 1};`);
|
||||
|
||||
export { client, createChannel, storeMessage };
|
||||
export { client, createChannel, storeMessage };
|
||||
|
Loading…
Reference in New Issue
Block a user