aboutsummaryrefslogtreecommitdiffstats
path: root/src/db.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/db.rs')
-rw-r--r--src/db.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/db.rs b/src/db.rs
index cf1c0fb..4297d25 100644
--- a/src/db.rs
+++ b/src/db.rs
@@ -71,6 +71,12 @@ impl Connection {
Ok(models::AggregatedScreening::from_query(s))
}
+ pub fn delete_screening(&self, screening_id: i32) -> QueryResult<usize> {
+ use crate::schema::screenings::dsl::*;
+ diesel::delete(screenings.filter(id.eq(screening_id)))
+ .execute(&**self)
+ }
+
pub fn create_room(&self, room_name: &String) -> QueryResult<usize> {
use crate::schema::rooms::dsl::*;
diesel::insert_into(rooms)