-
-
Notifications
You must be signed in to change notification settings - Fork 77
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.
First pass at feature #512
What's the best way to go about writing unit test for the withTransaction func?