New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add options.rawErrors to Sequelize#query
method
#13881
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! I only looked at the mssql docs changes and the eslint changes for now and have some comments on that
And it seems that Microsoft currently only offers 2017 & 2019 Docker images so we need to figure out a different way to test on 2014 if we really want to; https://hub.docker.com/_/microsoft-mssql-server |
Bummer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff. Thanks :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good on my end. Just need to resolve other reviewer's requests & fix tests :)
4c9f602
to
8815f6c
Compare
Howdy. Life's busy, but I've just updated the PR with a rebased branch. |
8815f6c
to
f406fe8
Compare
@ephys Hi. The pipeline is acting weird. A lot of MS SQL and MySQL fails which are completely unrelated with my work. |
Updating the branch to see if it still happens. It's not happening in the other PRs so if it still happens here it must be a subtle issue that was introduced :/ |
Unfortunately they are still failing. Could be related to the changes made in |
That would be quite fascinating given the randomness of the fails. Oh well, tomorrow I might try to push the branch one commit at a time. |
e03ceb0
to
0ce8e76
Compare
Fascinating. The pipeline passed without the _.merge() changes. Oh well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last note on my end I think, the rest looks good to me
@ephys I'm very confused. Something happened recently with the project now the partial build takes as long at the whole build... bah ! Since there is no benefit here, I'll just skip this commit as well... :/ |
0ce8e76
to
a3a2562
Compare
Strange. Do you happen to know around what time this change happened? For example a release/commit in which it still worked. So we can try to figure out what happened |
The past two weeks or so. There was a big commit about making eslint becoming more stringent and doing autoformatting. Perhaps that changed some settings. I could try to bisect this but then can leave it for another PR. |
I might be hallucinating. I tried a month old commit from early december. The age check doesn't work, it is still slow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
This option causes all errors from the underlying connection/database library to be propagated unformatted and unmodified. Use this for lesser common errors sequelize can't parse or in case you perfer to see the full raw errors.
a3a2562
to
05c5c84
Compare
I see a fail in DB2 + Node 16 but that is also happening in the main branch. |
Yeah we got a flaky test there, don't worry about that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry to hear that the incremental build did not work :/
The rest looks good to me though
I think we can safely add this to v6 too |
Sequelize#query
method
ok, who can merge ? |
Thank you for the PR! :) |
Co-authored-by: Zoé <zoe@ephys.dev> Co-authored-by: Rik Smale <13023439+WikiRik@users.noreply.github.com>
🎉 This PR is included in version 7.0.0-alpha.6 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Pull Request Checklist
Please make sure to review and check all of these items:
npm run test
ornpm run test-DIALECT
pass with this change (including linting)?Description Of Change
feat(query): added options.rawErrors to query() method
This option causes all errors from the underlying connection/database library
to be propagated unformatted and unmodified. Use this for lesser common errors
sequelize can't parse or in case you prefer to see the full raw errors.
Use case: in my project, we have a central database where different apps connect, like some scientific libraries and a REST API implemented using Node.JS. All errors in all apps are logged centrally. So, if there are DB errors, it is mostly productive to get the original error messages from the database so all developers understand them, and not just those that develop with node.js+sequelize. Also, Sequelize unfortunatelly cannot parse all errors, like at some point there was a cryptic error, because sequelize could not insert in a table with a trigger, something that was easily visible once we saw the original db error.
So, the rawErrors option is a nice to have for those that are not so interested in Sequelize's own error parsing. Also, it saves some CPU cyles. It can be set per query or in the global
sequelize.options.query
.Also bonus: stack handling for db2.
Todos