From bd771fd4a622289729e3aaa56e773721497fd72f Mon Sep 17 00:00:00 2001 From: alemi Date: Mon, 2 Dec 2024 23:41:42 +0100 Subject: [PATCH] fix: sql is hard --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index d7d13c1..0308470 100644 --- a/src/main.rs +++ b/src/main.rs @@ -196,7 +196,7 @@ impl Database { id INTEGER PRIMARY KEY AUTOINCREMENT, service INTEGER NOT NULL, time BIG INTEGER NOT NULL, - value BIG INTEGER NULL, + value BIG INTEGER NULL )", params![] )?; @@ -209,7 +209,7 @@ impl Database { db.execute( "CREATE TABLE IF NOT EXISTS services ( id INTEGER PRIMARY KEY AUTOINCREMENT, - name STRING NOT NULL, + name STRING NOT NULL )", params![] )?; @@ -267,7 +267,7 @@ impl Database { match res { Some(sid) => Ok(sid), None => { - self.0.lock().await.execute("INSERT INTO services(name) VALUES ?", params![service])?; + self.0.lock().await.execute("INSERT INTO services(name) VALUES (?)", params![service])?; self.sid(service).await } }