Skip to content
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

del function: bad typings? #5397

Open
HugoMuller opened this issue Nov 29, 2022 · 0 comments
Open

del function: bad typings? #5397

HugoMuller opened this issue Nov 29, 2022 · 0 comments

Comments

@HugoMuller
Copy link

Environment

Knex version: 2.3.0

If issue is about TypeScript definitions, tag @lorefnon.

Bug

I think there is an inconsistency in the del function typings:

When returning a single field with .del('id') , the return type seems good: an array of results like this Pick<MyType, 'id'>[]: https://github.com/knex/knex/blob/2.3.0/types/index.d.ts#L1146.

But achieving the same thing with an array .del(['id']), the type is different and actually is an array of arrays like this: DeferredKeySelection<MyType, "id", true, {}, false, {}, never>[][]
https://github.com/knex/knex/blob/2.3.0/types/index.d.ts#L1157

I guess this is a mistake? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant