Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Doobie Stream handling to the README #35

Closed
ghost opened this issue Feb 22, 2022 · 3 comments · Fixed by #53
Closed

Adds Doobie Stream handling to the README #35

ghost opened this issue Feb 22, 2022 · 3 comments · Fixed by #53
Milestone

Comments

@ghost
Copy link

ghost commented Feb 22, 2022

Doobie has support for transacting a fs2 stream. For ex: I can convert a Stream[ConnectionIO, A] into a Stream[IO, A] ( see doobie-final-streaming )

Does tranzactio provide similar functionality? If not, how would you simulate this?

@gaelrenoux
Copy link
Owner

Yes, tranzactio has a feature for this. In the Doobie package, you have a tzioStream method, which takes a fs2.Stream[ConnectionIO, A] and returns a zio.stream.ZStream[Connection, DbException, A].

I'll add this to the README.

@gaelrenoux gaelrenoux changed the title Support for transacting a Stream? Adds Doobie Stream handling to the README Feb 22, 2022
@ghost
Copy link
Author

ghost commented Feb 23, 2022

Oh I knew about tzioStream. The biggest thing I wanted to know was how to transform a ZStream[Connection DbException, A] into a ZStream[Database, DbException, A]. Currently, the transaction methods say for ex:Database#transactionOrDieR only operate on zio effects and not zio streams.

Whereas in Doobie (w/ using toZStream() from zio-interop-cats), you are able to transform Stream[ConnectionIO, A] into something like thisZStream[DoobieTransactorLayerProvider, Throwable, A]`

@gaelrenoux
Copy link
Owner

Ah OK, I get your point. Unfortunately, I'm not too familiar with ZIO streams, and in the sample streaming application I converted the stream to a ZIO before applying the Database. I'll try to take a look at this, but I welcome any PR on the subject.

@gaelrenoux gaelrenoux linked a pull request Mar 24, 2024 that will close this issue
@gaelrenoux gaelrenoux added this to the 5.2.0 milestone Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant