aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/db.rs5
-rw-r--r--src/models.rs2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/db.rs b/src/db.rs
index 59c4df3..60bbcde 100644
--- a/src/db.rs
+++ b/src/db.rs
@@ -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};