Skip to content

Update index.js#1313

Open
karjaneth wants to merge 1 commit intosidorares:masterfrom
karjaneth:patch-1
Open

Update index.js#1313
karjaneth wants to merge 1 commit intosidorares:masterfrom
karjaneth:patch-1

Conversation

@karjaneth
Copy link
Copy Markdown

Adding other constants modules as top-level getters. This will resolve a number of open bugs, including

In my own use case, we had been importing mysql2/lib/constants/errors in order to support retry-after-deadlock logic, which is now broken since the exports are defined in a more limited fashion in package.json. This will allow us to simply import mysql from 'mysql2' and use mysql.Errors for our situation.

Adding other constants modules as top-level getters. This will resolve a number of open bugs, including

* sidorares#1224
* sidorares#1216
* sidorares#1084

In my own use case, we had been importing `mysql2/lib/constants/errors` in order to support retry-after-deadlock logic, which is now broken since the `exports` are defined in a more limited fashion in `package.json`. This will allow us to simply `import mysql from 'mysql2'` and use `mysql.Errors` for our situation.
@karjaneth
Copy link
Copy Markdown
Author

@sidorares if you are OK with this change and merge it in, would you mind releasing a new version with it as soon as is reasonable? We are just hard-coding error codes until we can go back to importing them from mysql2.

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

Labels

needs rebase For internal organization purpose

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants