diff options
Diffstat (limited to 'src/db.rs')
-rw-r--r-- | src/db.rs | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -67,6 +67,13 @@ impl Connection { Ok(models::AggregatedScreening::from_query(s)) } + pub fn create_room(&self, room_name: &String) -> QueryResult<usize> { + use crate::schema::rooms::dsl::*; + diesel::insert_into(rooms) + .values(&name.eq(room_name)) + .execute(&**self) + } + pub fn get_rooms(&self) -> QueryResult<Vec<models::Room>> { use crate::schema::rooms::dsl::*; rooms.load(&**self) |