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 10, 2020
1 parent 4feefdf commit c31ef03
Show file tree
Hide file tree
Showing 2 changed files with 9 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
8 changes: 8 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

0 comments on commit c31ef03

Please sign in to comment.