diff options
-rw-r--r-- | src/db.rs | 5 | ||||
-rw-r--r-- | src/models.rs | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -53,6 +53,11 @@ impl Connection { .execute(&**self) } + pub fn get_screenings(&self) -> QueryResult<Vec<models::Screening>> { + use crate::schema::screenings::dsl::*; + screenings.load(&**self) + } + pub fn get_aggregated_screenings(&self) -> QueryResult<Vec<models::AggregatedScreening>> { use crate::schema::screenings::dsl::*; let s = screenings diff --git a/src/models.rs b/src/models.rs index 2d49ad1..a009f4f 100644 --- a/src/models.rs +++ b/src/models.rs @@ -22,4 +22,4 @@ pub mod screening; pub use film::{Film, NewFilm}; pub use room::Room; -pub use screening::{AggregatedScreening, NewScreening}; +pub use screening::{AggregatedScreening, NewScreening, Screening}; |