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

Function stream

tests/stream_tests.rs:10–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8
9#[sea_orm_macros::test]
10pub async fn stream() -> Result<(), DbErr> {
11 use futures_util::StreamExt;
12
13 let ctx = TestContext::new("stream").await;
14 create_tables(&ctx.db).await?;
15
16 let bakery = bakery::ActiveModel {
17 name: Set("SeaSide Bakery".to_owned()),
18 profit_margin: Set(10.4),
19 ..Default::default()
20 }
21 .save(&ctx.db)
22 .await?;
23
24 let result = Bakery::find_by_id(bakery.id.clone().unwrap())
25 .stream(&ctx.db)
26 .await?
27 .next()
28 .await
29 .unwrap()?;
30
31 assert_eq!(result.id, bakery.id.unwrap());
32
33 ctx.delete().await;
34
35 Ok(())
36}

Callers

nothing calls this directly

Calls 7

saveMethod · 0.80
unwrapMethod · 0.80
nextMethod · 0.80
newFunction · 0.50
create_tablesFunction · 0.50
streamMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected