-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
Improve transaction handling #538
Conversation
logger: Logger, | ||
file: String = #file, | ||
line: Int = #line, | ||
_ process: (PostgresConnection) async throws -> Result |
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.
Just realized for Swift 6 you probably want to have a variant that adds a isolation: isolated (any Actor)? = #isolation
as well.
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.
That's why I wanted a review from you :)
@FranzBusch please rereview. |
logger: Logger, | ||
file: String = #file, | ||
line: Int = #line, | ||
isolation: isolated (any Actor)? = #isolation, |
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.
This needs to be guarded to only apply in Swift 6, need a variant that doesn't have it for Swift 5. Same in PostgresClient.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #538 +/- ##
==========================================
- Coverage 61.67% 61.38% -0.30%
==========================================
Files 125 125
Lines 10099 10149 +50
==========================================
+ Hits 6229 6230 +1
- Misses 3870 3919 +49
|
public var rollbackError: Error? | ||
|
||
/// The error thrown while commiting the transaction. | ||
public var commitError: Error? |
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.
Do we want to have a public init for this?
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.
Not for now I think.
1c8e524
to
6b885c6
Compare
Those are fine as the |
Improve transaction handling a bit further:
PostgresTransactionError
PostgresTransactionError
if neededwithTransaction
function to PostgresConnection as wellcc @thoven87 @FranzBusch
Follow up to #519.