-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
feat(transaction): Adding withTransaction #519
base: main
Are you sure you want to change the base?
Conversation
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.
Added some more comments.
let _ = try await client.withTransaction(logger: logger) { transaction in | ||
try await transaction.query( | ||
""" | ||
INSERT INTO "\(unescaped: tableName)" (uuid) VALUES (\(iterations)); | ||
""", | ||
logger: logger | ||
) | ||
} |
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.
You don't check the error here at all. There is also nothing here to rollback.
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.
Tests have been updated. I apologize about skipping this part.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #519 +/- ##
==========================================
- Coverage 61.75% 61.68% -0.07%
==========================================
Files 125 125
Lines 10089 10099 +10
==========================================
Hits 6230 6230
- Misses 3859 3869 +10
|
First pass at feature #512
What's the best way to go about writing unit test for the withTransaction func?