diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index b6d1da1e55..37a0b46829 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Sequelize 4.27.9 +// Type definitions for Sequelize 4.27.10 // Project: http://sequelizejs.com // Definitions by: samuelneff // Peter Harris @@ -4006,7 +4006,7 @@ declare namespace sequelize { * because SQLite always runs INSERT OR IGNORE + UPDATE, in a single query, so there is no way to know * whether the row was inserted or not. */ - upsert(values: TAttributes, options?: UpsertOptions & { returning: false | undefined }): Promise; + upsert(values: TAttributes, options?: UpsertOptions & { returning?: false | undefined }): Promise; upsert(values: TAttributes, options?: UpsertOptions & { returning: true }): Promise<[TInstance, boolean]>; insertOrUpdate(values: TAttributes, options?: UpsertOptions & { returning: false | undefined }): Promise; insertOrUpdate(values: TAttributes, options?: UpsertOptions & { returning: true }): Promise<[TInstance, boolean]>; diff --git a/types/sequelize/sequelize-tests.ts b/types/sequelize/sequelize-tests.ts index 1572b91c00..9c5eb13708 100644 --- a/types/sequelize/sequelize-tests.ts +++ b/types/sequelize/sequelize-tests.ts @@ -1055,6 +1055,7 @@ findOrRetVal = User.findOrCreate( { where : { email : 'unique.email.@d.com', com findOrRetVal = User.findOrCreate( { where : { objectId : 1 }, defaults : { bool : false } } ); let upsertPromiseNoOptions: Bluebird = User.upsert( { id : 42, username : 'doe', foo : s.fn( 'upper', 'mixedCase2' ) } ); +let upsertPromiseWithNonReturningOptions: Bluebird = User.upsert( { id : 42, username : 'doe', foo : s.fn( 'upper', 'mixedCase2' ) }, { logging: true } ); let upsertPromiseReturning: Bluebird<[AnyInstance, boolean]> = User.upsert( { id : 42, username : 'doe', foo : s.fn( 'upper', 'mixedCase2' ) }, { returning: true } ); let upsertPromiseNotReturning: Bluebird = User.upsert( { id : 42, username : 'doe', foo : s.fn( 'upper', 'mixedCase2' ) }, { returning: false } );