18 Commits

Author SHA1 Message Date
Lorefnon
30c04c166d Update Knex.raw type to be any by default because the actual type is dialect specific (#3349) 2019-07-13 14:50:34 +02:00
Ricardo Graça
9aa7085b05 Rename src directory to lib (#3338) 2019-07-10 23:48:43 +02:00
Igor Savin
2ccaf3d724
Remove bluebird promises from typings. Do not pass promise to migrations and seeds. Remove knex.Promise (#3266) 2019-06-08 01:16:34 +02:00
Lorefnon
35efad1fa7 Fix some cases of left-to-right inference causing type mismatch (#3265)
Closes #3260
2019-06-08 00:40:06 +02:00
Lorefnon
0d1fb16240 Improve typings for aggregations (#3245) 2019-06-02 22:52:16 +02:00
Lorefnon
9f0da44ef2 Improve count typings (#3239)
- Make count generic, especially useful when being used with an alias object argument
- In case of alias object, partially infer the return type from the input.
2019-06-01 11:37:02 +02:00
Lorefnon
1b2b6bbf8c Update type of aggregation results to not be arrays when first had been invoked before (#3237)
Addresses: https://github.com/tgriesser/knex/issues/3229#issuecomment-497560577
2019-05-31 08:20:48 +02:00
Lorefnon
bd63288d41 Include undefined in Single row results (#3231) 2019-05-31 00:03:08 +02:00
Lorefnon
d62d280b4f Fix incorrect type definitions for single row queries (#3230)
Closes #3229
2019-05-29 22:48:10 +02:00
Lorefnon
fb91f654b8 Update Knex.Config types to include log (#3221)
Fixes #3148
2019-05-26 12:53:26 -07:00
Lorefnon
9c6ab963f6 Fix some more cases of missing typings (#3223)
* Fix some more cases of missing typings

- Add types for Seed API
- Add Knex#initialize (Closes #3192)

* Relax constraints on raw queries and add tests
2019-05-26 12:52:55 -07:00
Lorefnon
92cb805669 Support type safe refs (#3215) 2019-05-21 22:52:13 -07:00
Lorefnon
3b3fdf4c91 Fix issues with typings of joins and some conflicts with Bluebird typings (#3209) 2019-05-19 03:53:48 -07:00
Lorefnon
edd807f96c Resolve more issues around generic typings (#3208)
- Fix: update, insert, delete didn't support deferring of result resolution unlike select.
  So knex.insert(...).into<User>('users') would fall back to any

- Correctly handling cases when deferred selection keys get cleared later eg. multiple returning invocations, clearSelect.

- Fix: first resolves to array member rather than array.

- Add explanations for some of the complex type applications.
2019-05-18 00:47:06 +02:00
Lorefnon
91192fe4c4 Make typings more compatible with previous version (#3195) 2019-05-16 22:25:37 +02:00
Igor Savin
cf435d9175
Prepare for 0.16.7 release (#3190) 2019-05-12 17:21:40 +02:00
Lorefnon
1f4c8839a6 Add default values for generic types (#3189) 2019-05-12 16:32:13 +02:00
Lorefnon
6a4fecfe78 Make function types generic in type definitions (#3168)
* Make function types generic in type definitions

* Add dtslint and tests for type definitions
2019-05-04 10:34:07 +02:00