(db: &DbConn)
| 255 | } |
| 256 | |
| 257 | async fn find_together_json(db: &DbConn) -> Result<(), DbErr> { |
| 258 | print!("find cakes and fruits: "); |
| 259 | |
| 260 | let cakes_fruits = Cake::find() |
| 261 | .find_with_related(Fruit) |
| 262 | .into_json() |
| 263 | .all(db) |
| 264 | .await?; |
| 265 | |
| 266 | println!( |
| 267 | "\n{}\n", |
| 268 | serde_json::to_string_pretty(&cakes_fruits).unwrap() |
| 269 | ); |
| 270 | |
| 271 | Ok(()) |
| 272 | } |
| 273 | |
| 274 | async fn count_fruits_by_cake_json(db: &DbConn) -> Result<(), DbErr> { |
| 275 | print!("count fruits by cake: "); |
no test coverage detected