-
Notifications
You must be signed in to change notification settings - Fork 50
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
Preserve existing errors when using transaction #192
base: master
Are you sure you want to change the base?
Conversation
This looks good. Could you please change |
Hi @deusaquilus thanks for taking a look. Yes, I will take a look at this again this weekend and implement the remaining pieces. I will ping you again once it's ready to review. |
36e55d9
to
f34ee1f
Compare
Hi @deusaquilus I think this should be ready to review. Let me know if you have any feedback! :) |
import java.sql.SQLException | ||
|
||
val zioThatCanFail: ZIO[Connection, String, Nothing] = ZIO.service[Connection] *> ZIO.fail("Custom Error") | ||
"val result: ZIO[DataSource, String | SQLException, List[Person]] = zioThatCanFail.onDataSource" should compile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote the tests in this style (something must compile
) because the only thing that changed is the types. Let me know if you have any suggestions!
Hi @deusaquilus, did you have chance to look at the changes? Let me know if there is anything I can improve/change. |
Fixes #issue_number
Problem
I would like to be able to run ZIO effects without losing existing information on error channel.
For example;
Solution
I changed
ZioJdbcUnderlyingContext.transaction
Also updated
QuillZioExtPlain.onDataSource
andQuillZioExtPlain.implicitDS
so that can be run onZIO[Connection, E, T]
rather thanZIO[Connection, Throwable, T]
Notes
I only updated
ZioJdbcUnderlyingContext.transaction
as part of the initial PoC/Draft. If we are happy with the approach, we need to apply the same approach toZioJdbcContext.transaction
as well.Checklist
README.md
if applicable TODO[WIP]
to the pull request title if it's work in progress@getquill/maintainers