Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/sqlalchemy/dialects/mysql/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/sqlalchemy/dialects/mysql/__pycache__/oursql.cpython-311.pyc

�

�܋f����dZddlmZddlmZddlmZddlmZddlmZGd�d	e��Z	Gd
�de��Z
Gd�d
e��ZeZdS)a

.. dialect:: mysql+oursql
    :name: OurSQL
    :dbapi: oursql
    :connectstring: mysql+oursql://<user>:<password>@<host>[:<port>]/<dbname>
    :url: http://packages.python.org/oursql/

.. note::

    The OurSQL MySQL dialect is legacy and is no longer supported upstream,
    and is **not tested as part of SQLAlchemy's continuous integration**.
    The recommended MySQL dialects are mysqlclient and PyMySQL.

Unicode
-------

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


�)�BIT)�MySQLDialect)�MySQLExecutionContext�)�types)�utilc��eZdZd�ZdS)�
_oursqlBITc��dS)z'oursql already converts mysql bits, so.N�)�self�dialect�coltypes   �W/opt/cloudlinux/venv/lib64/python3.11/site-packages/sqlalchemy/dialects/mysql/oursql.py�result_processorz_oursqlBIT.result_processor(s	���t�N)�__name__�
__module__�__qualname__rrrrr
r
's#����������rr
c�$�eZdZed���ZdS)�MySQLExecutionContext_oursqlc�8�|j�dd��S)N�_oursql_plain_queryF)�execution_options�get)r
s r�plain_queryz(MySQLExecutionContext_oursql.plain_query/s���%�)�)�*?��G�G�GrN)rrr�propertyrrrrrr.s2������
�H�H��X�H�H�Hrrc�8�eZdZdZejrdZdZdZdZ	dZ
eZej
ejejejeei��Zed���Zdd�Zd�Zd�Zd�Zd	�Z	dd�Z	dd�Zdd
�Zdd�Zdd�Zdd�Z dd�Z!d�Z"d�Z#	dd�Z$d�Z%d�Z&d�Z'd�Z(dd�Z)dd�Z*dd�Z+dS)�MySQLDialect_oursql�oursqlTc� �td��S)Nr )�
__import__)�clss r�dbapizMySQLDialect_oursql.dbapiEs���(�#�#�#rNc�v�|r |jr|�|d���dS|�||��dS)zMProvide an implementation of
        *cursor.execute(statement, parameters)*.T�rN)r�execute)r
�cursor�	statement�
parameters�contexts     r�
do_executezMySQLDialect_oursql.do_executeIsL���	2�w�*�	2��N�N�9�$�N�7�7�7�7�7��N�N�9�j�1�1�1�1�1rc�X�|����dd���dS)N�BEGINTr&)r(r'�r
�
connections  r�do_beginzMySQLDialect_oursql.do_beginRs-�������#�#�G��#�>�>�>�>�>rc�D�tjr|j�|��}nG|j}|j�|�|�����|��}d|z}|�d����||z��dS)Nz'%s'T�r)	r�py2kr0�_escape_string�_connection_charset�encode�decoderr')r
r0�query�xid�arg�charsets      r�	_xa_queryzMySQLDialect_oursql._xa_queryUs����9�	��'�6�6�s�;�;�C�C��.�G��'�6�6��
�
�7�#�#����f�W�o�o�
��s�l���$�$��$�>�>�F�F��C�K�	
�	
�	
�	
�	
rc�4�|�|d|��dS)NzXA BEGIN %s�r=�r
r0r:s   r�do_begin_twophasez%MySQLDialect_oursql.do_begin_twophasegs�����z�=�#�6�6�6�6�6rc�b�|�|d|��|�|d|��dS)N�	XA END %sz
XA PREPARE %sr?r@s   r�do_prepare_twophasez'MySQLDialect_oursql.do_prepare_twophasejs4�����z�;��4�4�4����z�?�C�8�8�8�8�8rFc�f�|s|�|d|��|�|d|��dS)NrCzXA ROLLBACK %sr?�r
r0r:�is_prepared�recovers     r�do_rollback_twophasez(MySQLDialect_oursql.do_rollback_twophasens?���	9��N�N�:�{�C�8�8�8����z�#3�S�9�9�9�9�9rc�d�|s|�||��|�|d|��dS)NzXA COMMIT %s)rDr=rFs     r�do_commit_twophasez&MySQLDialect_oursql.do_commit_twophaseus>���	6��$�$�Z��5�5�5����z�>�3�7�7�7�7�7rc�|�tj||����d���||��S�NTr3)r�	has_table�connectr)r
r0�
table_name�schemas    rrNzMySQLDialect_oursql.has_table~s@���%����� � �2�2�t�2�L�L���	
�
�	
rc�z�tj||����d���|fd|i|��S�NTr3rQ)r�get_table_optionsrOr�r
r0rPrQ�kws     rrTz%MySQLDialect_oursql.get_table_options�sV���-����� � �2�2�t�2�L�L��
�
��	
�
�
�
�	
rc�z�tj||����d���|fd|i|��SrS)r�get_columnsrOrrUs     rrXzMySQLDialect_oursql.get_columns�sV���'����� � �2�2�t�2�L�L��
�
��	
�
�
�
�	
rc�x�tj||����d���fd|i|��SrS)r�get_view_namesrOr�r
r0rQrVs    rrZz"MySQLDialect_oursql.get_view_names�sS���*����� � �2�2�t�2�L�L�
�
��
��	
�
�	
rc�z�tj||����d���|��SrM)r�get_table_namesrOrr[s    rr]z#MySQLDialect_oursql.get_table_names�s=���+����� � �2�2�t�2�L�L��
�
�	
rc�t�tj||����d���fi|��SrM)r�get_schema_namesrOr)r
r0rVs   rr_z$MySQLDialect_oursql.get_schema_names�sI���,����� � �2�2�t�2�L�L�
�
��
�
�	
rc�T�tj||�d�����SrM)r�
initializerr/s  rrazMySQLDialect_oursql.initialize�s-���&��*�.�.�4�.�H�H�
�
�	
rc��tj||�d����d���|||��S)NT)�close_with_resultr3)r�_show_create_table�_contextual_connectr)r
r0�tabler<�	full_names     rrdz&MySQLDialect_oursql._show_create_table�sQ���.���*�*�"&�
+�
�
���D��9�9����
�
�	
rc��t||jj��r8|jduo.d|jdvo|jd�d��S|jdvS)Nr(r�closed)i�i�i�i�i)�
isinstancer$�ProgrammingError�errno�args�endswith)r
�er0r(s    r�
is_disconnectz!MySQLDialect_oursql.is_disconnect�sf���a���4�5�5�	=���4��1��A�F�1�I�-�1��F�1�I�&�&�x�0�0�
��7�<�<�<rc��|�ddd���}|�|j��tj|dt
��tj|dt��tj|dt��tj|dt��tj|d	t��|�d	d
��rd|d<ntj|dt��|�	dd
��|d<tj|dt��|�
dd
��i}dD]?}||vr9||||dd�<tj||dd�t��||=�@|r||d<g|gS)N�db�user�passwd)�database�username�password�port�compress�autoping�raise_on_warnings�default_charsetFr<�use_unicodeT�
found_rows)�ssl_ca�ssl_key�ssl_cert�
ssl_capath�
ssl_cipher��ssl)�translate_connect_args�updater9r�coerce_kw_type�int�bool�pop�strr�
setdefault)r
�url�optsr��keys     r�create_connect_argsz'MySQLDialect_oursql.create_connect_args�s����)�)��F�X�*�
�
��	
���C�I������D�&�#�.�.�.���D�*�d�3�3�3���D�*�d�3�3�3���D�"5�t�<�<�<���D�"3�T�:�:�:��8�8�%�u�-�-�	6�"�D��O�O����i��5�5�5�"�h�h�}�d�;�;��]����D�-��6�6�6�	
����d�+�+�+���
�
	�
	�C��d�{�{�#�C�y��C����G���#�C��Q�R�R��#�6�6�6���I���	��D��K��D�z�rc��|jS�N)rl)r
�	exceptions  r�_extract_error_codez'MySQLDialect_oursql._extract_error_code�s
����rc��|jjS)z:Sniff out the character set in use for connection results.)r0r<r/s  r�_detect_charsetz#MySQLDialect_oursql._detect_charset�s���$�,�,rc�*�|���S�z.oursql isn't super-broken like MySQLdb, yaaay.)�fetchall�r
�rpr<s   r�_compat_fetchallz$MySQLDialect_oursql._compat_fetchall�����{�{�}�}�rc�*�|���Sr�)�fetchoner�s   r�_compat_fetchonez$MySQLDialect_oursql._compat_fetchone�r�rc�*�|���Sr�)�firstr�s   r�
_compat_firstz!MySQLDialect_oursql._compat_firsts���x�x�z�z�rr�)TF)NN),rrr�driverrr4�supports_unicode_binds�supports_unicode_statements�supports_native_decimal�supports_sane_rowcount�supports_sane_multi_rowcountr�execution_ctx_cls�update_copyr�colspecs�sqltypes�Timerr
�classmethodr$r,r1r=rArDrIrKrNrTrXrZr]r_rardrpr�r�r�r�r�r�rrrrr4s!������
�F��y�+�!%��&*�#�"��!��#'� �4���t�����
�x�}�c�:�N���H��$�$��[�$�2�2�2�2�?�?�?�
�
�
�$7�7�7�9�9�9�
:?�:�:�:�:�:?�8�8�8�8�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�:>�
�
�
�
�=�=�=�&�&�&�P���-�-�-�
�������������rrN)
�__doc__�baserrr�rr�rr
rrrrrr�<module>r�s����0������������'�'�'�'�'�'�!�!�!�!�!�!����������������H�H�H�H�H�#8�H�H�H�O�O�O�O�O�,�O�O�O�d���r

Hacked By AnonymousFox1.0, Coded By AnonymousFox