@@ -76,89 +76,66 @@ def __init__(self, *args, **kwargs):
76
76
that you only use keyword parameters. Consult the MySQL C API
77
77
documentation for more information.
78
78
79
- host
80
- string, host to connect
81
-
82
- user
83
- string, user to connect as
84
-
85
- passwd
86
- string, password to use
87
-
88
- db
89
- string, database to use
90
-
91
- port
92
- integer, TCP/IP port to connect to
93
-
94
- unix_socket
95
- string, location of unix_socket to use
96
-
97
- conv
98
- conversion dictionary, see MySQLdb.converters
99
-
100
- connect_timeout
101
- number of seconds to wait before the connection attempt
102
- fails.
103
-
104
- compress
105
- if set, compression is enabled
106
-
107
- named_pipe
108
- if set, a named pipe is used to connect (Windows only)
109
-
110
- init_command
111
- command which is run once the connection is created
112
-
113
- read_default_file
114
- file from which default client values are read
115
-
116
- read_default_group
117
- configuration group to use from the default file
118
-
119
- cursorclass
120
- class object, used to create cursors (keyword only)
121
-
122
- use_unicode
123
- If True, text-like columns are returned as unicode objects
124
- using the connection's character set. Otherwise, text-like
125
- columns are returned as strings. columns are returned as
126
- normal strings. Unicode objects will always be encoded to
127
- the connection's character set regardless of this setting.
128
- Default to False on Python 2 and True on Python 3.
129
-
130
- charset
131
- If supplied, the connection character set will be changed
132
- to this character set (MySQL-4.1 and newer). This implies
133
- use_unicode=True.
134
-
135
- sql_mode
136
- If supplied, the session SQL mode will be changed to this
137
- setting (MySQL-4.1 and newer). For more details and legal
138
- values, see the MySQL documentation.
139
-
140
- client_flag
141
- integer, flags to use or 0
142
- (see MySQL docs or constants/CLIENTS.py)
143
-
144
- ssl
145
- dictionary or mapping, contains SSL connection parameters;
146
- see the MySQL documentation for more details
147
- (mysql_ssl_set()). If this is set, and the client does not
148
- support SSL, NotSupportedError will be raised.
149
-
150
- local_infile
151
- integer, non-zero enables LOAD LOCAL INFILE; zero disables
152
-
153
- autocommit
154
- If False (default), autocommit is disabled.
155
- If True, autocommit is enabled.
156
- If None, autocommit isn't set and server default is used.
157
-
158
- waiter
159
- Callable accepts fd as an argument. It is called after sending
160
- query and before reading response.
161
- This is useful when using with greenlet and async io.
79
+ :param str host: host to connect
80
+ :param str user: user to connect as
81
+ :param str password: password to use
82
+ :param str passwd: alias of password, for backward compatibility
83
+ :param str database: database to use
84
+ :param str db: alias of database, for backward compatibility
85
+ :param int port: TCP/IP port to connect to
86
+ :param str unix_socket: location of unix_socket to use
87
+ :param dict conv: conversion dictionary, see MySQLdb.converters
88
+ :param int connect_timeout:
89
+ number of seconds to wait before the connection attempt fails.
90
+
91
+ :param bool compress: if set, compression is enabled
92
+ :param str named_pipe: if set, a named pipe is used to connect (Windows only)
93
+ :param str init_command:
94
+ command which is run once the connection is created
95
+
96
+ :param str read_default_file:
97
+ file from which default client values are read
98
+
99
+ :param str read_default_group:
100
+ configuration group to use from the default file
101
+
102
+ :param type cursorclass:
103
+ class object, used to create cursors (keyword only)
104
+
105
+ :param str use_unicode:
106
+ If True, text-like columns are returned as unicode objects
107
+ using the connection's character set. Otherwise, text-like
108
+ columns are returned as strings. columns are returned as
109
+ normal strings. Unicode objects will always be encoded to
110
+ the connection's character set regardless of this setting.
111
+ Default to False on Python 2 and True on Python 3.
112
+
113
+ :param str charset:
114
+ If supplied, the connection character set will be changed
115
+ to this character set (MySQL-4.1 and newer). This implies
116
+ use_unicode=True.
117
+
118
+ :param str sql_mode:
119
+ If supplied, the session SQL mode will be changed to this
120
+ setting (MySQL-4.1 and newer). For more details and legal
121
+ values, see the MySQL documentation.
122
+
123
+ :param int client_flag:
124
+ flags to use or 0 (see MySQL docs or constants/CLIENTS.py)
125
+
126
+ :param dict ssl:
127
+ dictionary or mapping contains SSL connection parameters;
128
+ see the MySQL documentation for more details
129
+ (mysql_ssl_set()). If this is set, and the client does not
130
+ support SSL, NotSupportedError will be raised.
131
+
132
+ :param bool local_infile:
133
+ enables LOAD LOCAL INFILE; zero disables
134
+
135
+ :param bool autocommit:
136
+ If False (default), autocommit is disabled.
137
+ If True, autocommit is enabled.
138
+ If None, autocommit isn't set and server default is used.
162
139
163
140
There are a number of undocumented, non-standard methods. See the
164
141
documentation for the MySQL C API for some hints on what they do.
@@ -169,6 +146,11 @@ class object, used to create cursors (keyword only)
169
146
170
147
kwargs2 = kwargs .copy ()
171
148
149
+ if 'database' in kwargs2 :
150
+ kwargs2 ['db' ] = kwargs2 .pop ('database' )
151
+ if 'password' in kwargs2 :
152
+ kwargs2 ['passwd' ] = kwargs2 .pop ('password' )
153
+
172
154
if 'conv' in kwargs :
173
155
conv = kwargs ['conv' ]
174
156
else :
0 commit comments