Ë
    V.j|  ã                   ó:   — d Z ddlmZ ddlmZ  G d„ de«      ZeZy)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é   )Úlanghelpersc                   óš   ‡ — e Zd ZdZdZdZej                  d„ «       Ze	d„ «       Z
ej                  d„ «       Zd„ Zdˆ fd„	Zˆ fd	„Zd
„ Zˆ xZS )ÚMySQLDialect_pymysqlÚpymysqlTNc                 ó|   — 	 t        d«      j                  }|j                  | _        y# t        t
        f$ r Y yw xY w)Nzpymysql.cursorsTF)Ú
__import__ÚcursorsÚSSCursorÚ	_sscursorÚImportErrorÚAttributeError)Úselfr   s     úcC:\xampp\htdocs\tradingbinance\backend\.venv\Lib\site-packages\sqlalchemy/dialects/mysql/pymysql.pyÚsupports_server_side_cursorsz1MySQLDialect_pymysql.supports_server_side_cursors@   s?   € ð	Ü Ð!2Ó3×;Ñ;ˆGØ$×-Ñ-ˆDŒNØøÜœ^Ð,ò 	Ùð	ús   ‚&) ©;º;c                 ó   — t        d«      S )Nr   )r
   )Úclss    r   Úimport_dbapiz!MySQLDialect_pymysql.import_dbapiI   s   € ä˜)Ó$Ð$ó    c                 ó6  — 	 t        d«      j                  j                  }t        j                  |j
                  «      }	 |j                  d   }|dk(  xr  |j                   xs |j                  d   duS # t        $ r Y yw xY w# t        t        f$ r Y yw xY w)a  determine 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_pingz(MySQLDialect_pymysql._send_false_to_pingM   s¥   € ð	Ü#Ø%óç‰kŸ*™*ð ô ×3Ñ3°J·O±OÓDˆDðØ $§	¡	¨!¡�ð %¨Ñ3ò ØŸ™Ð%ÒF¨¯©°qÑ)9ÀÐ)Fðøô ò Ùðûô œ^Ð,ò 	Ùð	ús#   ‚B ÁA7 Á7	BÂBÂBÂBc                 ó`   — | j                   r|j                  d«       y|j                  «        y)NFT)r#   r   )r   Údbapi_connections     r   Údo_pingzMySQLDialect_pymysql.do_pingi   s/   € Ø×#Ò#Ø×!Ñ! %Ô(ð ð ×!Ñ!Ô#àr   c                 óB   •— |€t        d¬«      }t        ‰| �	  ||¬«      S )NÚuser)Úusername)Ú_translate_args)ÚdictÚsuperÚcreate_connect_args)r   Úurlr*   Ú	__class__s      €r   r-   z(MySQLDialect_pymysql.create_connect_argsq   s/   ø€ ØÐ"Ü"¨FÔ3ˆOÜ‰wÑ*Ø ð +ó 
ð 	
r   c                 ó°   •— t         ‰| �  |||«      ryt        || j                  j                  «      r#t        |«      j                  «       }d|v xs d|v S y)NTzalready closedzconnection was killedF)r,   Úis_disconnectÚ
isinstanceÚdbapiÚErrorÚstrÚlower)r   ÚeÚ
connectionÚcursorÚstr_er/   s        €r   r1   z"MySQLDialect_pymysql.is_disconnectx   sW   ø€ Ü‰7Ñ   J°Ô7ØÜ˜˜4Ÿ:™:×+Ñ+Ô,Ü˜“F—L‘L“NˆEà  EÐ)ÒMÐ-DÈÐ-Mðð r   c                 óx   — t        |j                  d   t        «      r|j                  d   }|j                  d   S )Nr   )r2   r   Ú	Exception)r   Ú	exceptions     r   Ú_extract_error_codez(MySQLDialect_pymysql._extract_error_codeƒ   s2   € Ü�i—n‘n QÑ'¬Ô3Ø!Ÿ™ qÑ)ˆIØ�~‰~˜aÑ Ð r   )N)Ú__name__Ú
__module__Ú__qualname__ÚdriverÚsupports_statement_cacheÚdescription_encodingr   Úmemoized_propertyr   Úclassmethodr   r#   r&   r-   r1   r>   Ú__classcell__)r/   s   @r   r   r   :   sn   ø„ Ø€FØ#ÐàÐà×"Ñ"ñó #ðð ñ%ó ð%ð ×"Ñ"ñó #ðò6õ
ô	ö!r   r   N)Ú__doc__Úmysqldbr   Úutilr   r   Údialect© r   r   Ú<module>rM      s*   ðñ*õX *Ý ôL!Ð/ô L!ð^ �r   