-
Notifications
You must be signed in to change notification settings - Fork 89
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
fix connection arguments mysql driver compatability #551
fix connection arguments mysql driver compatability #551
Conversation
…e "db" is deprecated/removed
Codecov Report
@@ Coverage Diff @@
## main #551 +/- ##
==========================================
- Coverage 77.12% 74.04% -3.08%
==========================================
Files 28 18 -10
Lines 2365 2254 -111
Branches 557 560 +3
==========================================
- Hits 1824 1669 -155
- Misses 383 413 +30
- Partials 158 172 +14
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
@betanummeric thanks for the PR!
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.
@betanummeric looks great, thank you!
…ons#551) * only use the "database" connection argument with driver versions where "db" is deprecated/removed * connection arguments: fix KeyError * connection arguments: fix KeyError * connection arguments: use 'passwd' instead of 'password' with older drivers * add changelog fragment * refactoring: use "get_connector_name" in "mysql_connect" --------- Co-authored-by: Felix Hamme <felix.hamme@ionos.com>
…ons#551) * only use the "database" connection argument with driver versions where "db" is deprecated/removed * connection arguments: fix KeyError * connection arguments: fix KeyError * connection arguments: use 'passwd' instead of 'password' with older drivers * add changelog fragment * refactoring: use "get_connector_name" in "mysql_connect" --------- Co-authored-by: Felix Hamme <felix.hamme@ionos.com>
bugfix for #546, relates to #116
what arguments are supported in what drivers
db
argument in 1.0.0 (2021), but it will probably still work for some time. I'm not sure since when pymysql supports thedatabase
argument, but at least since 0.7.11, which we test.db
. The project was last changed in 2014 so we could discuss if we want to support it. The current issue is about this old driver, see Possible recurrence of issue #151 following latest release of community.mysql? #546 (comment).db
argument in 2.1.0 (2021), like pymysql.The same way,
passwd
is deprecated in favor ofpassword
.proposed fix
Check the mysql driver version to determine what argument to use. Use
db
andpasswd
until it's deprecated, thendatabase
andpassword
.