knex: Property 'timeout' does not exist on type 'QueryBuilder'
Environment
Knex version: 0.19.3 Database + version: MySQL 5.7.22 OS: 10.14.6
If issue is about TypeScript definitions, tag @lorefnon.
Bug
-
Explain what kind of behaviour you are getting and how you think it should do
I’m using Typescript Version 3.5.1. When I upgrade knex version from 0.17.3 to 0.19.3, I got a compile error regarding timeout. It worked well before. 🙃
-
Error message
Property 'timeout' does not exist on type 'QueryBuilder<unknown, DeferredKeySelection<unknown, never, false, {}, false, {}, never>[]>'
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (3 by maintainers)
Commits related to this issue
- Fix some issues with QueryBuilder types (#3427) - Add missing typedefs for or and timeout (Closes #3422) - Move clone from QueryInterface to QueryBuilder — committed to knex/knex by lorefnon 5 years ago
- Gracefully handle global promise pollution - Update QueryInterface to proxy to only standard promise methods - Update QueryInterface type to be explicit about the methods being proxied This primar... — committed to knex/knex by lorefnon 5 years ago
- Gracefully handle global promise pollution - Update QueryInterface type to be explicit about the methods being proxied This primarily handles pollution of global Promise type by other libraries wh... — committed to knex/knex by lorefnon 5 years ago
- 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 pr... — committed to knex/knex by lorefnon 5 years ago
Released in 0.20.1
Same issue with the map - property. It works with 0.17.6 knex but breaks with 0.18.0 and newer.
Property 'map' does not exist on type 'QueryBuilder<unknown, (DeferredKeySelection<unknown, string, true, {}, boolean, {}, unknown> | DeferredKeySelection<unknown, "id", true, {}, false, {}, never>)[]>'@yigaldviri Right, so that forces all calls to
new Promiseto actually instantiate a Bluebird promise? Other than casting Knex native promises to Bluebird promises, I don’t think there is a possible solution for existing version; however, we are definitely going to look into at least addresing the.timeoutuse-case.