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

Allow beginTransaction and rollbackTransaction calls. #956

Closed
seivan opened this issue Apr 22, 2024 · 1 comment
Closed

Allow beginTransaction and rollbackTransaction calls. #956

seivan opened this issue Apr 22, 2024 · 1 comment
Labels
api Related to library's API duplicate This issue or pull request already exists enhancement New feature or request

Comments

@seivan
Copy link

seivan commented Apr 22, 2024

This is useful for unit tests that use the DB reference as a dependency injection on models.
By calling beginTransaction on setups and rollbacks on teardown, we can simulate an isolated sandbox environment for the database.

This would be similar to ecto where the death(?) of the process indicate the rollback. Since we can't rely on the many test runners to manage that, the easiest would be if one could call the functions manually and making sure that db is in a transaction during each test.

@igalklebanov
Copy link
Member

Hey 👋

Duplicate of #257.

@igalklebanov igalklebanov added duplicate This issue or pull request already exists enhancement New feature or request api Related to library's API labels Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Related to library's API duplicate This issue or pull request already exists enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants