
    -hH                     F    S r SSKJr  SSKJr  SSKJr   " S S\5      r\rg)	a  

.. dialect:: mysql+pymysql
    :name: PyMySQL
    :dbapi: pymysql
    :connectstring: mysql+pymysql://<username>:<password>@<host>/<dbname>[?<options>]
    :url: https://pymysql.readthedocs.io/

Unicode
-------

Please see :ref:`mysql_unicode` for current recommendations on unicode
handling.

.. _pymysql_ssl:

SSL Connections
------------------

The PyMySQL DBAPI accepts the same SSL arguments as that of MySQLdb,
described at :ref:`mysqldb_ssl`.   See that section for additional examples.

If the server uses an automatically-generated certificate that is self-signed
or does not match the host name (as seen from the client), it may also be
necessary to indicate ``ssl_check_hostname=false`` in PyMySQL::

    connection_uri = (
        "mysql+pymysql://scott:tiger@192.168.0.134/test"
        "?ssl_ca=/home/gord/client-ssl/ca.pem"
        "&ssl_cert=/home/gord/client-ssl/client-cert.pem"
        "&ssl_key=/home/gord/client-ssl/client-key.pem"
        "&ssl_check_hostname=false"
    )


MySQL-Python Compatibility
--------------------------

The pymysql DBAPI is a pure Python port of the MySQL-python (MySQLdb) driver,
and targets 100% compatibility.   Most behavioral notes for MySQL-python apply
to the pymysql driver as well.

   )MySQLDialect_mysqldb   )langhelpers)py3kc                      ^  \ rS rSrSrSrSrSrSr\	R                  S 5       r\S 5       r\	R                  S 5       rS rSU 4S	 jjrU 4S
 jr\(       a	  S rSrU =r$ SrU =r$ )MySQLDialect_pymysql9   pymysqlTNc                 ~     [        S5      R                  nUR                  U l        g! [        [
        4 a     gf = f)Nzpymysql.cursorsTF)
__import__cursorsSSCursor	_sscursorImportErrorAttributeError)selfr   s     vC:\Users\ROHAN GUPTA\OneDrive\Desktop\mathbuddy-assessment\venv\Lib\site-packages\sqlalchemy/dialects/mysql/pymysql.pysupports_server_side_cursors1MySQLDialect_pymysql.supports_server_side_cursorsE   s?    	 !23;;G$--DN^, 		s   &) <<c                     [        S5      $ )Nr
   )r   )clss    r   dbapiMySQLDialect_pymysql.dbapiN   s    )$$    c                 X    [        S5      R                  R                  n[        R                  " UR
                  5      n UR                  S   nUS:H  =(       a)    UR                  (       + =(       d    UR                  S   SL$ ! [         a     gf = f! [        [        4 a     gf = f)zdetermine if pymysql has deprecated, changed the default of,
or removed the 'reconnect' argument of connection.ping().

See #10492 and
https://github.com/PyMySQL/mysqlclient/discussions/651#discussioncomment-7308971
for background.

zpymysql.connectionsr   	reconnect    FT)r   connections
Connectionr   get_callable_argspecpingargsdefaults
IndexErrorr   r   )r   r   inspreconnect_args       r   _send_false_to_ping(MySQLDialect_pymysql._send_false_to_pingR   s    	#%k**  33JOODD $		! %3 %Fq)9)F   ^, 		s#   B B 
BBB)(B)c                 j    U R                   (       a  UR                  S5        gUR                  5         g)NFT)r'   r!   )r   dbapi_connections     r   
_ping_implMySQLDialect_pymysql._ping_impln   s/    ##!!%(  !!#r   c                 >   > Uc	  [        SS9n[        [        U ]  XS9$ )Nuser)username)_translate_args)dictsuperr   create_connect_args)r   urlr0   	__class__s      r   r3   (MySQLDialect_pymysql.create_connect_argsv   s1    ""F3O)4D E 
 	
r   c                    > [         [        U ]  XU5      (       a  g[        XR                  R
                  5      (       a*  [        U5      R                  5       nSU;   =(       d    SU;   $ g)NTzalready closedzconnection was killedF)r2   r   is_disconnect
isinstancer   Errorstrlower)r   e
connectioncursorstr_er5   s        r   r8   "MySQLDialect_pymysql.is_disconnect}   sc    %t:6
 
 ::++,,FLLNE E)M-D-M r   c                     [        UR                  S   [        5      (       a  UR                  S   nUR                  S   $ )Nr   )r9   r"   	Exception)r   	exceptions     r   _extract_error_code(MySQLDialect_pymysql._extract_error_code   s5    )..+Y77%NN1-	>>!$$r   )r   )N)__name__
__module____qualname____firstlineno__driversupports_statement_cachedescription_encodingsupports_unicode_statementssupports_unicode_bindsr   memoized_propertyr   classmethodr   r'   r+   r3   r8   r   rE   __static_attributes____classcell__)r5   s   @r   r   r   9   s    F#
 #'!"" # % % "" #6
 	% 	% r   r   N)__doc__mysqldbr   utilr   r   r   dialect r   r   <module>rY      s-   *X *  V%/ V%r r   