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

Function test_stream_2

src/database/mock.rs:661–676  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

659
660 #[smol_potat::test]
661 async fn test_stream_2() -> Result<(), DbErr> {
662 use fruit::Entity as Fruit;
663 use futures_util::TryStreamExt;
664
665 let db = MockDatabase::new(DbBackend::Postgres)
666 .append_query_results([Vec::<fruit::Model>::new()])
667 .into_connection();
668
669 let mut stream = Fruit::find().stream(&db).await?;
670
671 while let Some(item) = stream.try_next().await? {
672 let _item: fruit::ActiveModel = item.into();
673 }
674
675 Ok(())
676 }
677
678 #[smol_potat::test]
679 async fn test_stream_in_transaction() -> Result<(), DbErr> {

Callers

nothing calls this directly

Calls 4

into_connectionMethod · 0.80
append_query_resultsMethod · 0.80
newFunction · 0.50
streamMethod · 0.45

Tested by

no test coverage detected