(db: &DbConn)
| 46 | } |
| 47 | |
| 48 | async fn find_all(db: &DbConn) -> Result<(), DbErr> { |
| 49 | print!("find all cakes: "); |
| 50 | |
| 51 | let cakes: Vec<cake::Model> = Cake::find().all(db).await?; |
| 52 | |
| 53 | println!(); |
| 54 | for cc in cakes.iter() { |
| 55 | println!("{cc:?}\n"); |
| 56 | } |
| 57 | |
| 58 | print!("find all fruits: "); |
| 59 | |
| 60 | let fruits = Fruit::find().all(db).await?; |
| 61 | |
| 62 | println!(); |
| 63 | for ff in fruits.iter() { |
| 64 | println!("{ff:?}\n"); |
| 65 | } |
| 66 | |
| 67 | Ok(()) |
| 68 | } |
| 69 | |
| 70 | async fn find_one_to_one(db: &DbConn) -> Result<(), DbErr> { |
| 71 | print!("find fruits and cakes: "); |