+
    i                        R t ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^RI	H
t
 ^RIHt ^R	IHt ]'       d%   ^R
IHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt  ! R R]
4      t]tR# )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.

)annotations)Any)Dict)Optional)TYPE_CHECKING)Union)MySQLDialect_mysqldb)langhelpers)Literal)ConnectArgsType)DBAPIConnection)DBAPICursor)DBAPIModule)PoolProxiedConnection)URLc                     a  ] tR t^HtRtRtRt]P                  R R l4       t	]
R R l4       t]P                  R R	 l4       tR
 R ltRR V 3R llltR V 3R lltR R ltRtV ;t# )MySQLDialect_pymysqlpymysqlTNc                   V ^8  d   QhRR/#    returnbool )formats   "{C:\Users\petid\OneDrive\Desktop\Maestro\MAESTRO\maestro-backend\venv\Lib\site-packages\sqlalchemy/dialects/mysql/pymysql.py__annotate__!MySQLDialect_pymysql.__annotate__O   s      d     c                	     \        R 4      P                  pVP                  V n        R#   \        \
        3 d     R# i ; i)zpymysql.cursorsTF)
__import__cursorsSSCursor	_sscursorImportErrorAttributeError)selfr!   s   & r   supports_server_side_cursors1MySQLDialect_pymysql.supports_server_side_cursorsN   s?    	 !23;;G$--DN^, 		s   &* ??c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   r   X   s     % %[ %r   c                	    \        R 4      # )r   )r    )clss   &r   import_dbapi!MySQLDialect_pymysql.import_dbapiW   s    )$$r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r   \   s      T r   c                t    \        R4      P                  P                  p\        P                  ! VP
                  4      p VP                  ^,          pVR8H  ;'       d/    VP                  '       * ;'       g    VP                  ^ ,          RJ#   \         d     R# i ; i  \        \        3 d     R# i ; i)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.connections	reconnectFT)r    connections
Connectionr	   get_callable_argspecpingargsdefaults
IndexErrorr$   r%   )r&   r2   inspreconnect_args   &   r   _send_false_to_ping(MySQLDialect_pymysql._send_false_to_ping[   s    	#%k**  33JOODD $		! %3  %FFq)9)F   ^, 		s#   B" B BB"B76B7c                    V ^8  d   QhRRRR/# )r   dbapi_connectionr   r   zLiteral[True]r   )r   s   "r   r   r   w   s       M r   c                	p    V P                   '       d   VP                  R 4       R# VP                  4        R# )FT)r:   r4   )r&   r=   s   &&r   do_pingMySQLDialect_pymysql.do_pingw   s2    ###!!%(  !!#r   c               $    V ^8  d   QhRRRRRR/# )r   urlr   _translate_argszOptional[Dict[str, Any]]r   r   r   )r   s   "r   r   r      s$     
 

)A
	
r   c                	D   < Vf   \        RR7      p\        SV `	  WR7      # )Nuser)username)rC   )dictsupercreate_connect_args)r&   rB   rC   	__class__s   &&&r   rI   (MySQLDialect_pymysql.create_connect_args   s/     ""F3Ow* + 
 	
r   c               (    V ^8  d   QhRRRRRRRR/# )	r   ezDBAPIModule.Error
connectionz7Optional[Union[PoolProxiedConnection, DBAPIConnection]]cursorzOptional[DBAPICursor]r   r   r   )r   s   "r   r   r      s3       L &	
 
r   c                	   < \         SV `  WV4      '       d   R # \        WP                  P                  4      '       d,   \        V4      P                  4       pRV9   ;'       g    RV9   # R# )Tzalready closedzconnection was killedF)rH   is_disconnect
isinstanceloaded_dbapiErrorstrlower)r&   rM   rN   rO   str_erJ   s   &&&& r   rQ   "MySQLDialect_pymysql.is_disconnect   s`     7 77,,2233FLLNE E)MM-D-M r   c                    V ^8  d   QhRRRR/# )r   	exceptionBaseExceptionr   r   r   )r   s   "r   r   r      s     ! !] !s !r   c                	    \        VP                  ^ ,          \        4      '       d   VP                  ^ ,          pVP                  ^ ,          # )    )rR   r5   	Exception)r&   rZ   s   &&r   _extract_error_code(MySQLDialect_pymysql._extract_error_code   s5    innQ'33!q)I~~a  r   )r#   )N)__name__
__module____qualname____firstlineno__driversupports_statement_cachedescription_encodingr	   memoized_propertyr'   classmethodr,   r:   r?   rI   rQ   r_   __static_attributes____classcell__)rJ   s   @r   r   r   H   s}    F#"" # % % "" #6
 
  ! !r   r   N)__doc__
__future__r   typingr   r   r   r   r   mysqldbr   utilr	   util.typingr
   engine.interfacesr   r   r   r   r   
engine.urlr   r   dialectr   r   r   <module>ru      sT   )T #       )  "4400:!S!/ S!l r   