You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] - MSSQL - bulkCreate on BigInt fields fails #15411
the bulkCreate method should complete the operation.
What is actually happening?
The operation is failing because the bigint primitive is not well handled by the escape function in sql-string.js helper.
Adding a case statement on top of the existing numbermanagement would solve the issue because it will generate a correct SQL statement by removing the n at the end. (reference)
before
case 'number':
return val.toString();
after
case 'bigint':
case 'number':
return val.toString();
Environment
Sequelize version: 6.26.0
Node.js version: 14.20.0
If TypeScript related: TypeScript version: N\A
Database & Version: MSSQL 2016
Connector library & Version: tedious
Would you be willing to resolve this issue by submitting a Pull Request?
I can open a PR but I need assistance on how manage the automatic testing (if required)
No, I don't have the time, and I understand that I will need to wait until someone from the community or maintainers is interested in resolving my issue.
Indicate your interest in the resolution of this issue by adding the 👍 reaction. Comments such as "+1" will be removed.
thanks for the information!
Sequelize 7 is still in alpha so it is not an option (for now) since our software is running in production.
As for the conversion it will require us to modify the codebase in more than 100 functions to just to handle a cast that could be centralised on sequelize side.
I'm available to open a PR if it will speedup the resolution :)
Activity
ephys commentedon Dec 7, 2022
Just FYI, this is available in Sequelize 7 thanks to #14485 :)
In the meantime, you can convert the bigint to a string, that's what sequelize used before bigint were a thing in JS
marra85 commentedon Dec 7, 2022
Hello @ephys,
thanks for the information!
Sequelize 7 is still in alpha so it is not an option (for now) since our software is running in production.
As for the conversion it will require us to modify the codebase in more than 100 functions to just to handle a cast that could be centralised on sequelize side.
I'm available to open a PR if it will speedup the resolution :)
ephys commentedon Dec 7, 2022
That would definitely speed things up :) If you're willing to port #14485 to our v6 branch, I'll make sure to review it in a timely manner
fix: backport sequelize#14485 in v6 branch to resolve sequelize#15411
fix: backport sequelize#14485 in v6 branch to resolve sequelize#15411
github-actions commentedon Dec 12, 2022
🎉 This issue has been resolved in version 6.27.0 🎉
The release is available on:
Your semantic-release bot 📦🚀
WikiRik commentedon Dec 12, 2022
Thanks for working on this!