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 support for insert with alias #4003 #8791

Merged
merged 1 commit into from Mar 26, 2022

Conversation

zbarbuto
Copy link
Contributor

Description of change

Adds support for alias on insertQueryBuilder. This is particularly useful when dealing with ON CONFLICT as you can reference the original table to do an update or nothing based on a condition.

Fixes #4003

As an aside question - would it be possible to un-deprecate onConflict as it is still useful for this sort of complex ON CONFLICT work which isn't possible with orUpdate or orIgnore

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • npm run format to apply prettier formatting
  • npm run test passes with this change (*tests for the code I changed at least)
  • 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 (See above - onConflict has no docs right now)
  • The new commits follow conventions explained in CONTRIBUTING.md

@pleerock pleerock merged commit 4b37030 into typeorm:master Mar 26, 2022
@pleerock
Copy link
Member

Thank you for contribution! 🎉

M-TGH pushed a commit to TradeCast/typeorm that referenced this pull request Mar 29, 2022
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.

Support alias in insert into
2 participants