Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/user/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ This example will print:

.. code:: python

{'password': 'very-secret', 'id': 1}
{'id': 1, 'password': 'very-secret'}
20 changes: 12 additions & 8 deletions pymysql/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ class Connection:
:param ssl_verify_cert: Set to true to check the validity of server certificates
:param ssl_verify_identity: Set to true to check the server's identity
:param read_default_group: Group to read from in the configuration file.
:param compress: Not supported
:param named_pipe: Not supported
:param autocommit: Autocommit mode. None means use server default. (default: False)
:param local_infile: Boolean to enable the use of LOAD DATA LOCAL command. (default: False)
:param max_allowed_packet: Max size of packet sent to server in bytes. (default: 16MB)
Expand All @@ -149,9 +147,11 @@ class Connection:
an argument. For the dialog plugin, a prompt(echo, prompt) method can be used
(if no authenticate method) for returning a string from the user. (experimental)
:param server_public_key: SHA256 authentication plugin public key value. (default: None)
:param db: Alias for database. (for compatibility to MySQLdb)
:param passwd: Alias for password. (for compatibility to MySQLdb)
:param binary_prefix: Add _binary prefix on bytes and bytearray. (default: False)
:param compress: Not supported
:param named_pipe: Not supported
:param db: **DEPRECATED** Alias for database.
:param passwd: **DEPRECATED** Alias for password.

See `Connection <https://www.python.org/dev/peps/pep-0249/#connection-objects>`_ in the
specification.
Expand Down Expand Up @@ -205,12 +205,16 @@ def __init__(
db=None, # deprecated
):
if db is not None and database is None:
warnings.warn("'db' is deprecated, use 'database'", DeprecationWarning, 3)
# We will raise warining in 2022 or later.
# See https://github.com/PyMySQL/PyMySQL/issues/939
# warnings.warn("'db' is deprecated, use 'database'", DeprecationWarning, 3)
database = db
if passwd is not None and not password:
warnings.warn(
"'passwd' is deprecated, use 'password'", DeprecationWarning, 3
)
# We will raise warining in 2022 or later.
# See https://github.com/PyMySQL/PyMySQL/issues/939
# warnings.warn(
# "'passwd' is deprecated, use 'password'", DeprecationWarning, 3
# )
password = passwd

if compress or named_pipe:
Expand Down