Repository navigation
feat(postgres, sqlite): add conflictWhere option to Model.bulkCreate - #13420
Conversation
96b7c00 to
3438740
Compare
3438740 to
8f7eabe
Compare
|
Concerning that typing checks are passing for this, since this appears to be missing a type annotation for the |
There's no tests on that because I forgot to include it in this pull request. Thanks for the reminder though, I fixed this on another fork of sequelize and forgot to port that change back over. |
|
any updates on this change? it'd be very valuable to my team to have support for this functionality, since it's required for sequelize to fully support soft deletion. |
Adds an option to override the `upsertKeys` array passed to the query generator via setting `conflictFields`. Adds some TS tests for Model.bulkCreate.
late response, hoping to get this merged by end of month. |
Adds a conflictWhere option to Model.bulkCreate in postgres & sqlite which controls the clause in the `ON CONFLICT` part of the query. Backport of #13420.
Adds a conflictWhere option to Model.bulkCreate in postgres & sqlite which controls the clause in the `ON CONFLICT` part of the query. Backport of #13420.
Adds a conflictWhere option to Model.bulkCreate in postgres & sqlite which controls the clause in the `ON CONFLICT` part of the query. Backport of #13420.
Adds a conflictWhere option to Model.bulkCreate in postgres & sqlite which controls the clause in the `ON CONFLICT` part of the query. Backport of #13420.
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
conflictWheretoQueryGenerator.prototype.bulkInsertQuery. This is used to generate theON CONFLICT WHEREpart of the query (note: notON CONFLICT DO UPDATE WHERE).Model.bulkCreate,conflictWhere. (rather: documented the option)Note that this is based on #13419 - once that gets merged I'll rebase + remove that diff from this pr.
Example use case:
The bulkCreate would end up looking similar to this (for postgres):
Closes #12774.