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

fix: allow clearing database inside a transaction #8712

Merged

Conversation

varanauskas
Copy link
Contributor

Possible fix for: #8527

Description of change

This is one of the possible fixes for the issue #8527

It allows to run clearDatabase inside a transaction by making clearDatabase to check if another transaction is already running and not creating a new transaction in that case

It currently is only developed for/tested with Postgres, if this is the right direction same fix could be applied for other query runners

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • npm run lint passes with this change
  • npm run test passes with this change
  • This pull request links relevant issues as Fixes #0000
  • There are new or updated unit tests validating the change
  • Documentation has been updated to reflect this change
  • The new commits follow conventions explained in CONTRIBUTING.md

@varanauskas
Copy link
Contributor Author

This is re-opening of my previous pull request #8529

I have merged the rebased with master and adapted the necessary changes to all drivers that use transactions when clearing database

@pleerock pleerock merged commit f3cfdd2 into typeorm:master Mar 2, 2022
@pleerock
Copy link
Member

pleerock commented Mar 2, 2022

Thank you

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.

None yet

3 participants