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

return type for batch() is wrong on typescript #194

Closed
juicycool92 opened this issue Mar 15, 2022 · 2 comments
Closed

return type for batch() is wrong on typescript #194

juicycool92 opened this issue Mar 15, 2022 · 2 comments

Comments

@juicycool92
Copy link

mariadb version : 3.0.0
operating os : ubuntu 20.04

Hello,
thanks for nice module!

i have a question about types for batch() function

please, see the look at my code screenshot first.

image

above code are working perfectly, and i want to look how many of rows are affected like this variable from this docs

but there is types error on my IDE
image

i checked d.ts file and this look like array
image

after that, i tried to log the result and what exactly result look like.
[2022-03-15T03:18:41+00:00][logger][error]: {"affectedRows":1,"insertId":"0","warningStatus":0}

so, it looks like there is type declare error or i might be doin wrong totally.
can you help me what did i do wrong?

Thanks!

@antoHuman
Copy link

I can confirm the same issue with the return type. The promise resolves with the UpsertResult object (e. g. {"affectedRows":2,"insertId":"10","warningStatus":0}), when inserting multiple values, not with an array of those.

Are there some cases for which it actually returns UpsertResult[]?

I guess we need to use // @ts-ignore for now, or override the interface?

mariadb version : 2.5.5
operating os : Windows 10

@rusher
Copy link
Collaborator

rusher commented Feb 2, 2023

closing since corrected with CONJS-199 on 2.5.7/3.0.1

@rusher rusher closed this as completed Feb 2, 2023
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

3 participants