Skip to content

Commit

Permalink
fix(types): drop excess argument for upsert (#14156)
Browse files Browse the repository at this point in the history
  • Loading branch information
nsychev committed Feb 24, 2022
1 parent ae6a3f4 commit c2459f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/dialects/abstract/query-interface.d.ts
Expand Up @@ -485,13 +485,12 @@ export class QueryInterface {
/**
* Inserts or Updates a record in the database
*/
public upsert(
public upsert<M extends Model>(
tableName: TableName,
insertValues: object,
updateValues: object,
where: object,
model: ModelType,
options?: QueryOptions
options?: QueryOptionsWithModel<M>
): Promise<object>;

/**
Expand Down
2 changes: 1 addition & 1 deletion test/types/query-interface.ts
Expand Up @@ -223,7 +223,7 @@ async function test() {

class TestModel extends Model {}

await queryInterface.upsert("test", {"a": 1}, {"b": 2}, {"c": 3}, TestModel, {});
await queryInterface.upsert("test", {"a": 1}, {"b": 2}, {"c": 3}, {model: TestModel});

await queryInterface.insert(null, 'test', {});
}

0 comments on commit c2459f0

Please sign in to comment.