Skip to content

Commit

Permalink
Fix incorrect type of QueryBuilder.first('*') result
Browse files Browse the repository at this point in the history
Resolves #3619
  • Loading branch information
lorefnon committed Jan 9, 2020
1 parent 4feefdf commit 40521b6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion types/index.d.ts
Expand Up @@ -1258,7 +1258,7 @@ declare namespace Knex {
// we can extend our selection by these columns
(columnName: '*'): QueryBuilder<
TRecord,
DeferredKeySelection<TRecord, string>[]
ArrayIfAlready<TResult, DeferredKeySelection<TRecord, string>>
>;

<
Expand Down
9 changes: 9 additions & 0 deletions types/test.ts
Expand Up @@ -117,6 +117,14 @@ const main = async () => {
// $ExpectType any
await knex('users').first('id');

// $ExpectType any
await knex
.first('*')
.from('table')
.where({
whatever: 'whatever'
});

// $ExpectType any
await knex('users').first('id', 'name');

Expand Down Expand Up @@ -1336,4 +1344,5 @@ const main = async () => {

// $ExpectType any
knex.queryBuilder().queryContext();

};

0 comments on commit 40521b6

Please sign in to comment.