mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
[Sequelize] Fix types error with UpsertOptions requiring the returning option if they are defined at all (#25240)
* upsert should compile with options that dont include returning * fix parens * bump version for bugfix
This commit is contained in:
committed by
Wesley Wigham
parent
959c2e2e35
commit
73619f74ff
Vendored
+2
-2
@@ -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 <https://github.com/samuelneff>
|
||||
// Peter Harris <https://github.com/codeanimal>
|
||||
@@ -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<boolean>;
|
||||
upsert(values: TAttributes, options?: UpsertOptions & { returning?: false | undefined }): Promise<boolean>;
|
||||
upsert(values: TAttributes, options?: UpsertOptions & { returning: true }): Promise<[TInstance, boolean]>;
|
||||
insertOrUpdate(values: TAttributes, options?: UpsertOptions & { returning: false | undefined }): Promise<boolean>;
|
||||
insertOrUpdate(values: TAttributes, options?: UpsertOptions & { returning: true }): Promise<[TInstance, boolean]>;
|
||||
|
||||
@@ -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<boolean> = User.upsert( { id : 42, username : 'doe', foo : s.fn( 'upper', 'mixedCase2' ) } );
|
||||
let upsertPromiseWithNonReturningOptions: Bluebird<boolean> = 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<boolean> = User.upsert( { id : 42, username : 'doe', foo : s.fn( 'upper', 'mixedCase2' ) }, { returning: false } );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user