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

Function find_all_json

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

Source from the content-addressed store, hash-verified

239}
240
241async fn find_all_json(db: &DbConn) -> Result<(), DbErr> {
242 print!("find all cakes: ");
243
244 let cakes = Cake::find().into_json().all(db).await?;
245
246 println!("\n{}\n", serde_json::to_string_pretty(&cakes).unwrap());
247
248 print!("find all fruits: ");
249
250 let fruits = Fruit::find().into_json().all(db).await?;
251
252 println!("\n{}\n", serde_json::to_string_pretty(&fruits).unwrap());
253
254 Ok(())
255}
256
257async fn find_together_json(db: &DbConn) -> Result<(), DbErr> {
258 print!("find cakes and fruits: ");

Callers 1

all_about_select_jsonFunction · 0.85

Calls 2

allMethod · 0.45
into_jsonMethod · 0.45

Tested by

no test coverage detected