diff options
Diffstat (limited to 'src/db')
-rw-r--r-- | src/db/mod.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/db/mod.rs b/src/db/mod.rs index 03692e9..0dd4ddf 100644 --- a/src/db/mod.rs +++ b/src/db/mod.rs @@ -30,6 +30,15 @@ pub fn update(conn: &Connection, event: &Event) -> Result<()> { Ok(()) } +pub fn delete(conn: &Connection, id: &Uuid) -> Result<()> { + conn.execute( + "DELETE FROM events WHERE id = ?", + params![id.to_hyphenated().to_string()], + )?; + + Ok(()) +} + // TODO: Don’t use unwrap pub fn list(conn: &Connection) -> Result<Vec<Event>> { let mut stmt = conn.prepare("SELECT id, date, start, end, name FROM events")?; |