fix: sql is hard
This commit is contained in:
parent
b0b19c49b0
commit
bd771fd4a6
1 changed files with 3 additions and 3 deletions
|
@ -196,7 +196,7 @@ impl Database {
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
service INTEGER NOT NULL,
|
service INTEGER NOT NULL,
|
||||||
time BIG INTEGER NOT NULL,
|
time BIG INTEGER NOT NULL,
|
||||||
value BIG INTEGER NULL,
|
value BIG INTEGER NULL
|
||||||
)", params![]
|
)", params![]
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
@ -209,7 +209,7 @@ impl Database {
|
||||||
db.execute(
|
db.execute(
|
||||||
"CREATE TABLE IF NOT EXISTS services (
|
"CREATE TABLE IF NOT EXISTS services (
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
name STRING NOT NULL,
|
name STRING NOT NULL
|
||||||
)", params![]
|
)", params![]
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
@ -267,7 +267,7 @@ impl Database {
|
||||||
match res {
|
match res {
|
||||||
Some(sid) => Ok(sid),
|
Some(sid) => Ok(sid),
|
||||||
None => {
|
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
|
self.sid(service).await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue