Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/sqlalchemy/sql/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/sqlalchemy/sql/__pycache__/naming.cpython-311.pyc

�

�܋f��
��dZddlZddlmZddlmZddlmZddlmZddlmZdd	lm	Z	dd
lm
Z
ddlmZddlmZdd
lm
Z
ddlmZddlmZddlmZGd�de��Ze
dedede
de	diZd�Zd�Zejed��d���Zejed��eje
d��d�����ZdS)z5Establish constraint and index naming conventions.


�N�)�
_NONE_NAME)�conv)�CheckConstraint)�Column)�
Constraint)�ForeignKeyConstraint)�Index)�PrimaryKeyConstraint)�Table)�UniqueConstraint�)�event)�events)�excc�J�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�ZdS)�ConventionDictc�|�||_t|t��|_||_||_|j|_dS�N)�const�
isinstancer	�_is_fk�table�
convention�name�_const_name)�selfrrrs    �L/opt/cloudlinux/venv/lib64/python3.11/site-packages/sqlalchemy/sql/naming.py�__init__zConventionDict.__init__s9����
� ��(<�=�=�����
�$��� �:�����c��|jjSr)rr�rs r�_key_table_namezConventionDict._key_table_name&s���z��r c��|jr9	|jj|}t|j|��S#t
$rYdSwxYwt
|jj��}	||}t||��S#t
$rYdSwxYw)N�)rr�elements�getattr�parent�
IndexError�list�columns)r�idx�attrname�fk�cols�cols      r�	_column_XzConventionDict._column_X)s����;�	.�
4��Z�(��-���r�y�(�3�3�3���
�
�
��r�r�
����
��
�*�+�+�D�
.��3�i���s�H�-�-�-���
�
�
��r�r�
���s�0�
>�>�A3�3
B�Bc��|jdtfvrtjd���t	|jt
��sd|j_|jS)NzcNaming convention including %(constraint_name)s token requires that constraint is explicitly named.)rrr�InvalidRequestErrorrrrrr"s r�_key_constraint_namez#ConventionDict._key_constraint_name:sX�����j�1�1�1��)�2���
�
�$�*�D�1�1�	#�"�D�J�O���r c�.�|�|d��S)N�key�r1�rr,s  r�_key_column_X_keyz ConventionDict._key_column_X_keyEs���~�~�c�5�)�)�)r c�.�|�|d��S)Nrr7r8s  r�_key_column_X_namez!ConventionDict._key_column_X_nameKs���~�~�c�6�*�*�*r c�.�|�|d��S)N�
_ddl_labelr7r8s  r�_key_column_X_labelz"ConventionDict._key_column_X_labelNs���~�~�c�<�0�0�0r c��|jjd}|j�d��}t	|��dkr|\}}}n|\}}|S)Nr�.�)rr&�target_fullname�split�len)rr.�refs�	refschema�reftable�refcols      r�_key_referred_table_namez'ConventionDict._key_referred_table_nameQsS��
�Z�
 ��
#���!�'�'��,�,���t�9�9��>�>�*.�'�I�x���#��H�f��r c�>�|jj|}|jjSr)rr&�columnr)rr,r.s   r�_key_referred_column_X_namez*ConventionDict._key_referred_column_X_nameZs��
�Z�
 ��
%���y�~�r c��||jvr!|j||j|j��St|d|z��rt	|d|z����Stjd|��}|�rU|�d��}|�d��}|r�|jr
|jj	}nt|jj��}g}t|��D]k\}}d|�
d|zd��z}	|�t	||��|�����O#t$rt!|���wxYw|�d��rdnd	}	|	�|��Sd|�
|d��z}t'|��}t||��rt	||��|��St!|���)
Nz_key_%sz.*_?column_(\d+)(_?N)?_.+rr�_key_�0�X�_r%)rrr�hasattrr'�re�match�grouprr&r*r+�	enumerate�replace�append�AttributeError�KeyError�
startswith�join�int)
rr6�col_templater,�	multiples�elems�tokens�elem�attr�seps
          r�__getitem__zConventionDict.__getitem__as����$�/�!�!�'�4�?�3�'��
�D�J�?�?�?�
�T�9�s�?�
+�
+�	8�1�7�4��S��1�1�3�3�3��8�$@�#�F�F�L��
8�"�(�(��+�+��(�.�.�q�1�1�	��8��{�9� $�
� 3��� $�T�Z�%7� 8� 8���F�%.�u�%5�%5�0�0�	��T�&����S�9�_�c�)J�)J�J��0�"�M�M�*=�'�$��*=�*=�c�*B�*B�C�C�C�C��-�0�0�0�"*�3�-�-�/�0����!*�!5�!5�c�!:�!:�B�#�#��C��8�8�F�+�+�+�"�S�[�[��c�%:�%:�:�D��c�(�(�C��t�T�*�*�8�2�w�t�T�2�2�3�7�7�7��s�m�m�s�=,D*�*EN)
�__name__�
__module__�__qualname__rr#r1r4r9r;r>rIrLre�r rrrs�������&�&�&����.�.�.�"	 �	 �	 �*�*�*�+�+�+�1�1�1�����������r r�ix�pk�ck�uqr.c��|jD]=}|tvr$t||vr|t|cS||vr
||cS�>dSr)�__mro__�_prefix_dict)�dict_r6�super_s   r�_get_conventionrs�sh���+�����\�!�!�l�6�&:�e�&C�&C���f�-�.�.�.�.�
�u�_�_���=� � � ���tr c�f�|j}t|jt|����}t	|jt��r|jS|�Yt	|jt��s?|j�d|vs|jtur&t
|t|||j��z��S|turdSdS)N�constraint_name)	�metadatars�naming_convention�typerrrrr)rrrvrs    r�_constraint_name_for_tablery�s����~�H� ��!;�T�%�[�[�I�I�J��%�*�d�#�#���z�����5�:�t�,�,�	�
�J�� �J�.�.��z�Z�'�'����U�E�8�+E�F�F�
G�
�
�	
�
�z�	!�	!��t�
"�	!r �'_sa_event_column_added_to_pk_constraintc�j�|jr)|j}d|_t||��}|r||_dSdSdSr)�_implicit_generatedrrry)�
pk_constraintr0r�newnames    r�_column_added_to_pk_constraintr�sZ���(�	)�
�#��!�
��,�]�E�B�B���	)�!(�M����	)�	)�	)�	)r �after_parent_attachc� ��t|t��rtj|d�fd���dSt|t��rEt�jt��s�jturdSt�|��}|r|�_dSdSdS)Nr�c�$��t�|��Sr)�_constraint_name)r0rrs  �r�<lambda>z"_constraint_name.<locals>.<lambda>�s���/��u�=�=�r )	rrr�listenrrrrry)rrr~s`  rr�r��s�����%�� � �!�	���!�=�=�=�=�	
�	
�	
�	
�	
�
�E�5�	!�	!�!��e�j�$�'�'�	�5�:��+C�+C��F�,�U�E�:�:���	!� �E�J�J�J�
!�!�
	!�	!r )�__doc__rSr&rr�schemarrrr	r
rrr
r%rrr�objectrrprsry�listens_forrr�rir r�<module>r�s�����

�	�	�	� � � � � � �������#�#�#�#�#�#�������������(�(�(�(�(�(�������(�(�(�(�(�(�������$�$�$�$�$�$�������������������a�a�a�a�a�V�a�a�a�J
�4��$��T��d��$���������.����C���
)�
)���
)����:�4�5�5����5�/�0�0�!�!�1�0�6�5�!�!�!r 

Hacked By AnonymousFox1.0, Coded By AnonymousFox