You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(postgres): native updateOnConflict for upsert - #11246
Please make sure to review and check all of these items:
Does npm run test or npm run test-DIALECT pass with this change (including linting)?
Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
Have you added new tests to prevent regressions?
Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
Did you update the typescript typings accordingly (if applicable)?
Did you follow the commit message conventions explained in CONTRIBUTING.md?
Description of change
replace the function to catch exception on existing element for upsert method with Postgres by the native method ON CONFLICT () UPDATE SET, it is supported by postgres >= 9.5, is this blocking ?
Without your PR, what is the minimum required postgres version? (I probably should know this, but I don't...)
papb
added
dialect: postgres
For issues and PRs. Things that involve PostgreSQL (and do not involve all dialects).
status: awaiting response
For issues and PRs. OP must respond (or change something, if it is a PR). Maintainers have no action
type: refactor
DEPRECATED: replace with the "meta" issue type
labels
Jul 30, 2019
if we look at the previous default version, it was 9.4
but a previous PR #11163 on bulkInsert with the same ON CONFLICT syntax already implicit set required version to 9.5
I will try this week.
But I find out that with this native upsert, we lose the information if it is an insert or an update,
And it may not work on case with 2 distinct unique constraints.
So i do not know if we must detect in which case we are to keep existing temp function for some edge case, and use native upsert for others ?
What did you think ?
I will try this week. But I find out that with this native upsert, we lose the information if it is an insert or an update, And it may not work on case with 2 distinct unique constraints. So i do not know if we must detect in which case we are to keep existing temp function for some edge case, and use native upsert for others ? What did you think ?
Can you show a SSCCE/MVCE/reprex for the situation that is covered by Sequelize's workaround that is not covered by the native implementation?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dialect: postgresFor issues and PRs. Things that involve PostgreSQL (and do not involve all dialects).status: awaiting responseFor issues and PRs. OP must respond (or change something, if it is a PR). Maintainers have no actiontype: refactorDEPRECATED: replace with the "meta" issue type
4 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request check-list
Please make sure to review and check all of these items:
npm run testornpm run test-DIALECTpass with this change (including linting)?Description of change
replace the function to catch exception on existing element for upsert method with Postgres by the native method ON CONFLICT () UPDATE SET, it is supported by postgres >= 9.5, is this blocking ?
Closes #4132