diff --git a/src/db.rs b/src/db.rs index 194f2bb..671bb95 100644 --- a/src/db.rs +++ b/src/db.rs @@ -106,6 +106,19 @@ pub async fn get_script>(pool: &SqlitePool, id: T) -> Result<(Uuid )) } +#[allow(dead_code)] +pub async fn delete_script>(pool: &SqlitePool, id: T) -> Result<(), String> { + if let Err(e) = sqlx::query("DELETE FROM scripts WHERE id = ?") + .bind(id.as_ref()) + .execute(pool) + .await + { + Err(e.to_string()) + } else { + Ok(()) + } +} + // TODO: Return Vec