MCPcopy
hub / github.com/PyMySQL/PyMySQL / __init__

Method __init__

pymysql/connections.py:175–372  ·  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

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

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