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 #6867 #7590

Merged
merged 3 commits into from
Apr 24, 2021
Merged

Fix #6867 #7590

merged 3 commits into from
Apr 24, 2021

Conversation

PauloRSF
Copy link
Contributor

Description of change

Fixes #6867.

Postgres' database creation and dropping were not implemented and just (silently) resolved an empty promise. As the comment above createDatabase stated, database creation really isn't allowed inside transaction blocks, but, if a user tries to do that, the query runner should throw an error.

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

* implement the createDatabase, dropDatabase and hasDatabase methods on postgres' query runner

Closes #6867
* Set ifNotExist=false when testing with postgres' driver
* Add empty promise return when ifNotExist is true and the specified database already exists on postgres' query runner
* Set ifNotExist as true on the database creation and dropping tests
@AlexMesser AlexMesser merged commit 974d2d4 into typeorm:master Apr 24, 2021
@AlexMesser
Copy link
Collaborator

thank you for contribution!

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.

Silent failure in createDatabase and dropDatabase with postgres
2 participants