
    h                       d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dd	l	m
Z
 dd
lmZ ddlmZ ddlmZ er*ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ  G d de      Z G d de      ZeZy)a  

.. dialect:: mysql+cymysql
    :name: CyMySQL
    :dbapi: cymysql
    :connectstring: mysql+cymysql://<username>:<password>@<host>/<dbname>[?<options>]
    :url: https://github.com/nakagami/CyMySQL

.. note::

    The CyMySQL dialect is **not tested as part of SQLAlchemy's continuous
    integration** and may have unresolved issues.  The recommended MySQL
    dialects are mysqlclient and PyMySQL.

    )annotations)Any)Iterable)Optional)TYPE_CHECKING)Union   )MySQLDialect)MySQLDialect_mysqldb)BIT   )util)
Connection)DBAPIConnection)DBAPICursor)DBAPIModule)Dialect)PoolProxiedConnection)_ResultProcessorTypec                       e Zd Z	 	 	 	 	 	 ddZy)_cymysqlBITc                    dd}|S )z@Convert MySQL's 64 bit, variable length binary string to a long.c                B    | d}t        |       D ]
  }|dz  |z  } |S | S )Nr      )iter)valuevis      _/var/www/html/eduruby.in/venv/lib/python3.12/site-packages/sqlalchemy/dialects/mysql/cymysql.pyprocessz-_cymysqlBIT.result_processor.<locals>.process4   s7     e #AQ
A#L    )r   zOptional[Iterable[int]]returnzOptional[int] )selfdialectcoltyper    s       r   result_processorz_cymysqlBIT.result_processor/   s    
	 r!   N)r%   r   r&   objectr"   z#Optional[_ResultProcessorType[Any]])__name__
__module____qualname__r'   r#   r!   r   r   r   .   s    )/	,r!   r   c                      e Zd ZdZdZdZdZdZdZ e	j                  ej                  eei      Zed	d       Zd
dZddZ	 	 	 	 	 	 	 	 ddZy)MySQLDialect_cymysqlcymysqlTNFc                    t        d      S )Nr.   )
__import__)clss    r   import_dbapiz!MySQLDialect_cymysql.import_dbapiJ   s    )$$r!   c                .    |j                   j                  S N)
connectioncharset)r$   r5   s     r   _detect_charsetz$MySQLDialect_cymysql._detect_charsetN   s    $$,,,r!   c                    |j                   S r4   )errno)r$   	exceptions     r   _extract_error_codez(MySQLDialect_cymysql._extract_error_codeQ   s    r!   c                    t        || j                  j                        r| j                  |      dv S t        || j                  j                        ryy)N)i  i  i  i  i  TF)
isinstanceloaded_dbapiOperationalErrorr;   InterfaceError)r$   er5   cursors       r   is_disconnectz"MySQLDialect_cymysql.is_disconnectT   sW     a**;;<++A. 3   4,,;;< r!   )r"   r   )r5   r   r"   str)r:   DBAPIModule.Errorr"   int)rA   rE   r5   z7Optional[Union[PoolProxiedConnection, DBAPIConnection]]rB   zOptional[DBAPICursor]r"   bool)r)   r*   r+   driversupports_statement_cachedescription_encodingsupports_sane_rowcountsupports_sane_multi_rowcountsupports_unicode_statementsr   update_copyr
   colspecsr   r   classmethodr2   r7   r;   rC   r#   r!   r   r-   r-   ?   s    F#!#( "&t 5 5[7IJH% %- L &	
 
r!   r-   N)__doc__
__future__r   typingr   r   r   r   r   baser
   mysqldbr   typesr    r   engine.baser   engine.interfacesr   r   r   r   r   sql.type_apir   r   r-   r%   r#   r!   r   <module>r[      sc    #        )  )400,:4# "(/ (V r!   