New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix query builder promise typings #1689
Conversation
This is an insanely breaking change and we cannot merge it before 3.0, which is far in the future. |
Which is totally reasonable. Though it is worth noting that it is kind of broken as-is. I just want to make sure everyone is aware of it so it can be fixed, far in the future if need be. |
Yeah, it's broken and this is s good change, but you are the first person to bring this up so it doesn't seem that critical. |
Fair enough. I think what that means is that nobody is using Feel free to close and reopen when 3.0 is realistic, or whatever else seems appropriate. 👍 |
I don't think I agree with that. Sure, the typings change a bit, but no one is having |
@capaj So you don't think anyone has created a function like this: function getUser(id: number): Promise<User> {
return User.query().findById(id);
} I'm pretty sure most projects have. |
Supporting knex >= 0.95 requires us to make breaking changes, so I'll release a 3.0 soon. This will be fixed at the same time. |
Cant merge because of conflicts, but I copy pasted the relevant parts and this will be merged soon. Thank you for your contribution! |
Fixes for #1688.
Note that this is a breaking change for any dependents written in TypeScript.
CatchablePromiseLike
can be returned fromasync
functions no problem, but as can be seen in the changes toexamples.ts
, any non-async function or variable that explicitly defines aPromise
type will need to be changed.