177 Commits

Author SHA1 Message Date
Lorefnon
63986fade3 Make the default type parameters of QueryBuilder less strict (#3520)
Resolves #3519
2019-11-11 00:51:13 +01:00
Lorefnon
af129408ca Fix regression in older version of node when Promise#finally
was not available

- More closely align the ChainableInterface type to reality

Resolves #3507
2019-11-02 22:35:24 +05:30
Lorefnon
6f5a13d3ab Gracefully handle global promise pollution (#3502)
Update QueryInterface to proxy to only standard promise methods
Update QueryInterface type to be explicit about the methods being
proxied
This primarily handles pollution of global Promise (either the type or
the global object at runtime) by other libraries.

Fixes: #3422
2019-10-29 08:49:15 +01:00
Oran Epelbaum
f4b6848594 Dynamic connection configuration resolution (#3497) 2019-10-27 16:14:18 +01:00
Timothy Ng
d806ec0c20 #3367 Add interface for PG Connection object (#3372) 2019-10-26 08:04:51 +02:00
EthanHur
2d0459111d orderBy accepts QueryBuilder (#3491) 2019-10-24 16:08:12 +02:00
Luiz Felipe Gonçalves
49076445cb feat: Add types to the Migrator interface (#3459) 2019-10-21 23:42:55 +02:00
Jiri Spac
dd3ba822a5 fix typings of index and dropIndex TableBuilder methods (#3486) 2019-10-21 22:15:54 +02:00
Keith Smith
767904c3a2 Fixes types for Seeder#run (#3438) 2019-10-14 16:56:19 +02:00
Nekrasov Ilya
6b9fb0ec01 disable_migrations_list_validation_feature (#3448) 2019-10-12 21:45:39 +02:00
Igor Savin
516b074790
Enable linting in CI (#3450) 2019-10-06 20:20:46 +02:00
Adrian Olek
fb095cb59c Add missing Migrator.list typing (#3460) 2019-10-03 20:35:36 +02:00
Lorefnon
b74456492c Fix Typescript type inference for to better support wildcard (*) calls #3444 (#3446) 2019-09-22 23:05:31 +02:00
Lorefnon
eb8f0c0b2d Make options argument optional in timeout (#3442) 2019-09-15 12:09:40 +02:00
Michael Chris Lopez
019141c030 Add specific to SeederConfig type (#3429) 2019-09-09 17:50:04 +02:00
Lorefnon
6c73b22fd9 Fix some issues with QueryBuilder types (#3427)
- Add missing typedefs for or and timeout (Closes #3422)
- Move clone from QueryInterface to QueryBuilder
2019-09-05 23:18:00 +02:00
Taras Ozarko
3f86d75a46 TypeScript definition: include schemaName in EnumOptions (#3415) 2019-08-26 13:39:06 +02:00
Allan Jardine
5003241a9d #3405 Allow ColumnBuilder.defaultTo() to be null (#3407) 2019-08-22 14:58:40 +02:00
Felix Mosheev
8111bb3ee8 Feat: Allow to extend knex query builder (#3334) 2019-07-23 20:45:03 +02:00
Matthew Kuo
054ce36b0a Add .isCompleted() to transaction (#3368) 2019-07-23 17:59:55 +02:00
Evan Ross
ec6091ecba Update configuration typings to allow for oracle db connectionstring (#3361) 2019-07-23 00:11:18 +02:00
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
Igor Savin
fb06464da0
Update tarn.js (#3345)
* Update tarn.js
* Remove beforeDestroy
2019-07-11 14:57:59 +02:00
Ricardo Graça
9aa7085b05 Rename src directory to lib (#3338) 2019-07-10 23:48:43 +02:00
Ricardo Maes
bc1ddcad01 Implement "skipLocked()" and "noWait()" (#2961) 2019-07-06 14:05:53 +02:00
Igor Savin
f328fbbdb4
Expose executionPromise for transactors (#3297) 2019-06-19 22:12:21 +02:00
Keith Smith
141b202969 adds stub to seeds type (#3296) 2019-06-19 17:51:26 +02:00
David Mair Spiess
f70b7264b2 Add pgsql specific table builder method typings (#3146) 2019-06-19 10:21:41 +02:00
Joel Gallant
31983c19a4 Adds stub type definition (#3279) 2019-06-18 00:40:08 +02:00
shaungreen
87d4c0b374 Fix MSSQL config typings (#3269) 2019-06-10 15:15:33 +02:00
Lorefnon
a47756e7a1 [Typings] Add workarounds for degraded inference when strictNullChecks is set to false (#3275)
Closes #3274
2019-06-09 21:12:27 +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
Quinn Chaffee
ab6a3047aa Remove Bluebird.try (#3263) 2019-06-07 23:30:39 +02:00
Lorefnon
501d58a6d9 Address concerns around count typings (#3249)
* Use number instead of number | string for return type of count

Closes #3247

* Use an alias instead of interface for DeferredKeySelection

This prevents typescript from complaining when it has to be used in an exported signature without us having to expose internal type as public

Closes #3259

* Make count result type overridable

* Disable interface-over-type-literal rule
2019-06-06 08:24:28 +02:00
Lorefnon
0d1fb16240 Improve typings for aggregations (#3245) 2019-06-02 22:52:16 +02:00
Sangmin Lee
0521beac82 Add decimalNumbers to MySqlConnectionConfig interface (#3244) 2019-06-02 15:20:24 +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
Lee Allen
1fe5ee0ea3 Add migrate:down functionality (#3228) 2019-05-30 00:37:18 +02:00
Lorefnon
d62d280b4f Fix incorrect type definitions for single row queries (#3230)
Closes #3229
2019-05-29 22:48:10 +02:00
Igor Savin
5307dacc66
Implement support for returning started transaction without using transaction() methods callback function (#3099) 2019-05-26 18:03:07 -07: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
5dab3a5e74 Expose some utility types
Ref: https://github.com/tgriesser/knex/pull/3036#issuecomment-493751631

Co-authored-by: Sagar Chamling <sgr.raee@gmail.com>
2019-05-19 13:28:15 -07:00
Lorefnon
e2e044c0f2 Unify object options handling for datetime/timestamp across dialects and update type definitions (#3181)
* Fix windows incompatiblity in npm scripts

* Update timestamp and datetime signature in oracle dialect to be consistent with other dialects
2019-05-19 05:10:59 -07:00
Lee Allen
08478f2db9 Feature/add up for migrations (#3205)
* Add ability to run migrate:up command to only run the next migration

* Add cli test for migrate:up

* Add test for migrator

* Add stub

* Add type

* Fix wording of test
2019-05-19 04:14:52 -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