Closed lucklove closed 2 months ago
Thanks for your report.
Seems there is a precision loss for lastInsertId
. I will take a deep look tomorrow.
lastInsertId will lose precision when it exceeds the MAX_SAFE_INTEGER of the number type
After some research, we decide to change the type of lastInsertId to string in https://github.com/tidbcloud/serverless-js/pull/66 to prevent the overflow. It will be a break change and we will release v0.2.0 after pr is merged
Close as it has been resolved. Please reopen it if have any questions
The output will be something like
3746994889972252700
(multiple of 100) but the real id is3746994889972252673