mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
As per the documentation findOr methods return an array including the instance and a boolean.
This commit is contained in:
parent
08c30a2c3d
commit
32b7b6cab7
8
sequelize/v3/index.d.ts
vendored
8
sequelize/v3/index.d.ts
vendored
@ -3819,8 +3819,8 @@ declare namespace sequelize {
|
||||
* Find a row that matches the query, or build (but don't save) the row if none is found.
|
||||
* The successfull result of the promise will be (instance, initialized) - Make sure to use .spread()
|
||||
*/
|
||||
findOrInitialize(options: FindOrInitializeOptions<TAttributes>): Promise<TInstance>;
|
||||
findOrBuild(options: FindOrInitializeOptions<TAttributes>): Promise<TInstance>;
|
||||
findOrInitialize(options: FindOrInitializeOptions<TAttributes>): Promise<[TInstance, boolean]>;
|
||||
findOrBuild(options: FindOrInitializeOptions<TAttributes>): Promise<[TInstance, boolean]>;
|
||||
|
||||
/**
|
||||
* Find a row that matches the query, or build and save the row if none is found
|
||||
@ -3833,13 +3833,13 @@ declare namespace sequelize {
|
||||
* an instance of sequelize.TimeoutError will be thrown instead. If a transaction is created, a savepoint
|
||||
* will be created instead, and any unique constraint violation will be handled internally.
|
||||
*/
|
||||
findOrCreate(options: FindOrInitializeOptions<TAttributes>): Promise<TInstance>;
|
||||
findOrCreate(options: FindOrInitializeOptions<TAttributes>): Promise<[TInstance, boolean]>;
|
||||
|
||||
/**
|
||||
* A more performant findOrCreate that will not work under a transaction (at least not in postgres)
|
||||
* Will execute a find call, if empty then attempt to create, if unique constraint then attempt to find again
|
||||
*/
|
||||
findCreateFind(options: FindCreateFindOptions<TAttributes>): Promise<TInstance>;
|
||||
findCreateFind(options: FindCreateFindOptions<TAttributes>): Promise<[TInstance, boolean]>;
|
||||
|
||||
/**
|
||||
* Insert or update a single row. An update will be executed if a row which matches the supplied values on
|
||||
|
||||
Loading…
Reference in New Issue
Block a user