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

feat(transaction): Adding withTransaction #519

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

thoven87
Copy link

First pass at feature #512

What's the best way to go about writing unit test for the withTransaction func?

Copy link
Collaborator

@fabianfett fabianfett left a 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.

Tests/IntegrationTests/PostgresClientTests.swift Outdated Show resolved Hide resolved
Comment on lines 102 to 109
let _ = try await client.withTransaction(logger: logger) { transaction in
try await transaction.query(
"""
INSERT INTO "\(unescaped: tableName)" (uuid) VALUES (\(iterations));
""",
logger: logger
)
}
Copy link
Collaborator

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.

Copy link
Author

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.

@thoven87 thoven87 requested a review from fabianfett December 16, 2024 04:49
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 this pull request may close these issues.

3 participants