summaryrefslogtreecommitdiff
path: root/dichroism/src/image_repo.rs
blob: c36f94e36214979cbf5aee4bf0af45390caf6fcd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use super::models::ProductImg;
use diesel::prelude::*;
use diesel::result::Error;

type DBConn = SqliteConnection;

pub fn read_images(conn: &DBConn) -> Result<Vec<ProductImg>, Error> {
    use crate::schema::images::dsl::*;
    let results = images.load::<ProductImg>(conn)?;
    Ok(results)
}

pub fn create_image() {
    todo!()
}

pub fn update_image() {
    todo!()
}

pub fn delete_image() {
    todo!()
}

#[cfg(test)]
mod tests {

    #[test]
    fn test() -> std::result::Result<(), Box<dyn std::error::Error>> {
        Ok(())
    }
}