summaryrefslogblamecommitdiff
path: root/dichroism/src/image_repo.rs
blob: c36f94e36214979cbf5aee4bf0af45390caf6fcd (plain) (tree)































                                                                      
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(())
    }
}