Don't lock database operations to a single thread

This commit is contained in:
Ethan O'Brien
2025-11-30 10:48:16 -06:00
parent b9b344b50c
commit fd47262f52
5 changed files with 80 additions and 98 deletions

View File

@@ -22,12 +22,12 @@ lazy_static! {
static ref DATABASE: SQLite = SQLite::new("gree.db", setup_tables);
}
fn setup_tables(conn: &SQLite) {
conn.create_store_v2("CREATE TABLE IF NOT EXISTS users (
fn setup_tables(conn: &rusqlite::Connection) {
conn.execute_batch("CREATE TABLE IF NOT EXISTS users (
cert TEXT NOT NULL,
uuid TEXT NOT NULL,
user_id BIGINT NOT NULL PRIMARY KEY
)");
);").unwrap();
}
fn update_cert(uid: i64, cert: &str) {