MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / find_together_json

Function find_together_json

examples/basic/src/select.rs:257–272  ·  view source on GitHub ↗
(db: &DbConn)

Source from the content-addressed store, hash-verified

255}
256
257async 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
274async fn count_fruits_by_cake_json(db: &DbConn) -> Result<(), DbErr> {
275 print!("count fruits by cake: ");

Callers 1

all_about_select_jsonFunction · 0.85

Calls 3

find_with_relatedMethod · 0.80
allMethod · 0.45
into_jsonMethod · 0.45

Tested by

no test coverage detected