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: add option to upsert to skip update if the row already exists and no values would be changed #8679

Conversation

joeflateau
Copy link
Contributor

Description of change

This change adds an option to upsert methods that instructs postgresql to skip the update if the update would not change any of a row's values. Without this, postgres will write every row to disk for each row that is upserted even if nothing has actually changed.

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

@pleerock pleerock merged commit 8744395 into typeorm:master Feb 22, 2022
@joeflateau
Copy link
Contributor Author

thank you

@pleerock
Copy link
Member

thanks for another improvement :)

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

2 participants