Typescript Error
Anyone know why this is happening? I upgraded my drizzle version so maybe something changed?
![No description](https://answer-overflow-discord-attachments.s3.us-east-1.amazonaws.com/1249737553955782729/image.png)
6 Replies
Any ideas?
Was the type changed in newer versions?
;c
Looks like
MySqlRawQueryResult
is a tuple. The first element response[0]
is of type ResultSetHeader
which has the affectedRows
property.
Try response?.[0]?.affectedRows
This worked thank you, where did you find the type? I could not find it in docs anywhere
It's not in the docs as far as I can tell. I searched for
MySqlRawQueryResult
in the source codeIf you import the type like this
In VS Code, you can right click and go to type definition.
![No description](https://answer-overflow-discord-attachments.s3.us-east-1.amazonaws.com/1250211711735300136/CleanShot_2024-06-11_at_17.14.132x.jpg)
That shows a type like:
And you can keep following the type definitions