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: Accept queryLabel query option for logging. #14787
Conversation
3883fc3
to
fcbd534
Compare
fcbd534
to
4ab5074
Compare
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.
Seems like a nice feature to add. Could you add a test for when the query has been executed as well (the afterMsg
). And maybe we should add something for when queryName is ''
so that you don't get an additional empty character at the start.
fdd9f90
to
54f7318
Compare
54f7318
to
df38925
Compare
Co-authored-by: Rik Smale <13023439+WikiRik@users.noreply.github.com>
Thanks for this PR! About the documentation, you can open a PR on the website repo to add it to the logging section; https://github.com/sequelize/website/blob/main/docs/getting-started.mdx#logging but since it's also mentioned in the types it should be reflected in the API reference as well. |
@WikiRik Updated the docstring. Thanks for the quick review! |
Co-authored-by: Rik Smale <13023439+WikiRik@users.noreply.github.com>
🎉 This PR is included in version 7.0.0-alpha.15 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Pull Request Checklist
Please make sure to review and check all of these items:
yarn test
oryarn test-DIALECT
pass with this change (including linting)?Description Of Change
Accept
queryLabel
as query option (open to alternate names, likeloggingLabel
or justlabel
). Extremely useful for labeling queries when query logging is turned on. For example, when I have query logging turned on and I hit an endpoint in one of my applications, a dozen or more queries may show up in the logs. This allows me to provide a name/label so I can quickly jump to the code that produced a given query.Todos