Adding preliminary table work and breadalert framing

This commit is contained in:
2025-06-24 21:45:45 -04:00
parent d9561d9179
commit 617a49bb16
7 changed files with 86 additions and 3 deletions

View File

@@ -17,7 +17,11 @@ export class SqliteDB implements sql_common {
console.log(err)
throw err
} else {
return result.changes
if (result != null) {
return result.changes
} else {
return 0
}
}
})
})

View File

@@ -0,0 +1,11 @@
import { sql_common } from "./interfaces";
const tables: string[] = [
"CREATE TABLE IF NOT EXISTS servers (server_snowflake bigint NOT NULL PRIMARY KEY,server_name text NOT NULL,server_description mediumtext);",
"CREATE TABLE IF NOT EXISTS channels (channel_snowflake bigint NOT NULL PRIMARY KEY,server_snowflake bigint NOT NULL,channel_name text NOT NULL);"
]
export async function makeTables(db: sql_common): Promise<number[]> {
return Promise.all(tables.map((statement) => db.run(statement)))
}