Fix issue with modify not accepting arguments

This commit is contained in:
Hugo Dozois
2018-06-28 12:15:24 -07:00
parent bd35c127a6
commit aa71a4e166
2 changed files with 5 additions and 3 deletions

View File

@@ -155,7 +155,7 @@ declare namespace Knex {
pluck(column: string): QueryBuilder;
insert(data: any, returning?: string | string[]): QueryBuilder;
modify(callback: QueryCallback, ...args: any[]): QueryBuilder;
modify(callback: QueryCallbackWithArgs, ...args: any[]): QueryBuilder;
update(data: any, returning?: string | string[]): QueryBuilder;
update(columnName: string, value: Value, returning?: string | string[]): QueryBuilder;
returning(column: string | string[]): QueryBuilder;
@@ -360,6 +360,8 @@ declare namespace Knex {
//
type QueryCallback = (this: QueryBuilder, builder: QueryBuilder) => void;
type QueryCallbackWithArgs = (this: QueryBuilder, builder: QueryBuilder, ...args: any[]) => void;
interface QueryBuilder extends QueryInterface, ChainableInterface {
or: QueryBuilder;
and: QueryBuilder;

View File

@@ -1045,10 +1045,10 @@ knex('users')
}).unionAll(function(builder) {
let self: Knex.QueryBuilder = this;
self = builder;
}).modify(function(builder) {
}).modify(function(builder, aBool) {
let self: Knex.QueryBuilder = this;
self = builder;
});
}, true);
//
// Migrations