Skip to content

fix the type of ResultSetHeader **insertId** attribute type#1267

Open
buuug7 wants to merge 1 commit intosidorares:masterfrom
buuug7:master
Open

fix the type of ResultSetHeader **insertId** attribute type#1267
buuug7 wants to merge 1 commit intosidorares:masterfrom
buuug7:master

Conversation

@buuug7
Copy link
Copy Markdown

@buuug7 buuug7 commented Dec 20, 2020

database table ID either number or string

database table ID either **number** or **string**
@testn
Copy link
Copy Markdown
Contributor

testn commented Nov 5, 2021

Nope. LastInsertId has to be number.

https://dev.mysql.com/doc/internals/en/packet-OK_Packet.html

@sidorares
Copy link
Copy Markdown
Owner

when bigNumberStrings setting is set to true insertId is returned as string ( when it can't fit js number )

@testn
Copy link
Copy Markdown
Contributor

testn commented Nov 5, 2021

ah I forgot

@sidorares
Copy link
Copy Markdown
Owner

sidorares commented Nov 5, 2021

I'm not a fan of this polymorphic results but not quite sure how to improve ( and in backwards compatible way )

we can probably retire Long.js and return native BigInt here so the type will be number | BigInt ( still polymorphic )

@wellwelwel wellwelwel added typescript needs rebase For internal organization purpose needs investigation labels Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs investigation needs rebase For internal organization purpose typescript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants