MCPcopy Create free account
hub / github.com/PyMySQL/PyMySQL / __init__

Method __init__

pymysql/connections.py:177–373  ·  view source on GitHub ↗
(
        self,
        *,
        user=None,  # The first four arguments is based on DB-API 2.0 recommendation.
        password="",
        host=None,
        database=None,
        unix_socket=None,
        port=0,
        charset="",
        collation=None,
        sql_mode=None,
        read_default_file=None,
        conv=None,
        use_unicode=True,
        client_flag=0,
        cursorclass=Cursor,
        init_command=None,
        connect_timeout=10,
        read_default_group=None,
        autocommit=False,
        local_infile=False,
        max_allowed_packet=16 * 1024 * 1024,
        defer_connect=False,
        auth_plugin_map=None,
        read_timeout=None,
        write_timeout=None,
        bind_address=None,
        binary_prefix=False,
        program_name=None,
        server_public_key=None,
        ssl=None,
        ssl_ca=None,
        ssl_cert=None,
        ssl_disabled=None,
        ssl_key=None,
        ssl_key_password=None,
        ssl_verify_cert=None,
        ssl_verify_identity=None,
        compress=None,  # not supported
        named_pipe=None,  # not supported
        passwd=None,  # deprecated
        db=None,  # deprecated
    )

Source from the content-addressed store, hash-verified

175 _secure = False
176
177 def __init__(
178 self,
179 *,
180 user=None, # The first four arguments is based on DB-API 2.0 recommendation.
181 password="",
182 host=None,
183 database=None,
184 unix_socket=None,
185 port=0,
186 charset="",
187 collation=None,
188 sql_mode=None,
189 read_default_file=None,
190 conv=None,
191 use_unicode=True,
192 client_flag=0,
193 cursorclass=Cursor,
194 init_command=None,
195 connect_timeout=10,
196 read_default_group=None,
197 autocommit=False,
198 local_infile=False,
199 max_allowed_packet=16 * 1024 * 1024,
200 defer_connect=False,
201 auth_plugin_map=None,
202 read_timeout=None,
203 write_timeout=None,
204 bind_address=None,
205 binary_prefix=False,
206 program_name=None,
207 server_public_key=None,
208 ssl=None,
209 ssl_ca=None,
210 ssl_cert=None,
211 ssl_disabled=None,
212 ssl_key=None,
213 ssl_key_password=None,
214 ssl_verify_cert=None,
215 ssl_verify_identity=None,
216 compress=None, # not supported
217 named_pipe=None, # not supported
218 passwd=None, # deprecated
219 db=None, # deprecated
220 ):
221 if db is not None and database is None:
222 warnings.warn("'db' is deprecated, use 'database'", DeprecationWarning, 3)
223 database = db
224 if passwd is not None and not password:
225 warnings.warn(
226 "'passwd' is deprecated, use 'password'", DeprecationWarning, 3
227 )
228 password = passwd
229
230 if compress or named_pipe:
231 raise NotImplementedError(
232 "compress and named_pipe arguments are not supported"
233 )
234

Callers

nothing calls this directly

Calls 5

_create_ssl_ctxMethod · 0.95
connectMethod · 0.95
ParserClass · 0.85
getMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected