-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(typings): upsert options (#10655)
- Loading branch information
1 parent
ea5afbf
commit a676eea
Showing
2 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import {Model} from "sequelize" | ||
import {sequelize} from './connection'; | ||
|
||
class TestModel extends Model { | ||
} | ||
|
||
TestModel.init({}, {sequelize}) | ||
|
||
sequelize.transaction(trx => { | ||
return TestModel.upsert({}, { | ||
benchmark: true, | ||
fields: ['testField'], | ||
hooks: true, | ||
logging: true, | ||
returning: true, | ||
searchPath: 'DEFAULT', | ||
transaction: trx, | ||
validate: true, | ||
}) | ||
}) |
@sushantdhiman as a note, we create a bunch of interfaces for single aspects like there, in the future it would be good if we make sure that fields like
validate
andhooks
get their own interface to avoid duplication.