-
-
Notifications
You must be signed in to change notification settings - Fork 610
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
Add default connection attributes #1825
Conversation
LGTM, thanks for adding this @Daemonxiao could you link mysql docs in a comment and add few words explaining what/why these attributes are ( and that names are not something we made up and are common agreed ) Also can you rewrite a commit message to follow https://www.conventionalcommits.org/en/v1.0.0/ ( also - might need to rebase once again a bit later, currently PlanetScale check is failing for some reason. I'll try to fix or disable that today ) |
@sidorares Thanks for your review. I have rewritten the commit message. Does it meet the requirements? Please feel free to tell me if you have any advice. |
Yep, perfect. release-please is using commit messages to automatically populate feature / release / chore section of the release post, and also only prepares a release if there a new "releasable items" since the last one. |
Maybe it's better to move the change to connection_config, where other default connection parameters are node-mysql2/lib/connection_config.js Line 172 in 2c1b4bc
use line like const defaultConnectAttributes = {
_client_name: 'Node-MySQL-2',
_client_version: version
};
this.connectAttributes = { ...defaultConnectAttributes, ...(options.connectAttributes || {})); |
@sidorares Thank you very much. This really excellent advice. I have applied it in nearly commit. |
@Daemonxiao some unit tests are failing, could you try running them locally? |
@sidorares Done. |
@sidorares Is this pr ready to be merged? Or is there anything else I can do? |
MySQL connectors have some Available Connection Attributes.
I add the following built-in connection attributes to Node-MySQL-2.
These attributes will help users distinguish which driver the connection comes from.