ok

Mini Shell

Direktori : /opt/cloudlinux/venv/lib/python3.11/site-packages/alembic/ddl/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/alembic/ddl/__pycache__/base.cpython-311.pyc

�

�܋f�%��t�ddlmZddlZddlmZddlmZddlmZddlmZddlm	Z	ddlm
Zdd	lm
Z
dd
lmZddlmZddlmZd
dlmZd
dlmZd
dlmZd
dlmZd
dlmZer<ddlmZddlmZddlmZddlmZddlmZddl m!Z!ddl"m#Z#ddl$m%Z%d
dlm&Z&d
dlm'Z'eddd e(fZ)Gd!�d"e��Z*Gd#�d$e*��Z+Gd%�d&e*��Z,Gd'�d(e,��Z-Gd)�d*e,��Z.Gd+�d,e,��Z/Gd-�d.e,��Z0Gd/�d0e,��Z1Gd1�d2e,��Z2Gd3�d4e*��Z3Gd5�d6e*��Z4Gd7�d8e,��Z5e
e+��d^d>���Z6e
e3��d_d?���Z7e
e4��d`d@���Z8e
e-��dadA���Z9e
e.��dbdB���Z:e
e/��dcdC���Z;e
e0��dddD���Z<e
e1��dedE���Z=e
e2��dfdF���Z>dgdK�Z?dhdO�Z@didP�ZAdjdS�ZBdkdV�ZCdldX�ZDdmdY�ZEdmdZ�ZFdnd]�ZGdS)o�)�annotationsN)�Optional)�
TYPE_CHECKING)�Union)�exc)�Integer)�types)�compiles)�Column)�
DDLElement)�quoted_name�)�_columns_for_constraint)�
_find_columns)�_fk_spec)�_is_type_bound)�_table_for_constraint)�Any)�Compiled)�DDLCompiler)�
TextClause)�Function)�FetchedValue)�
TypeEngine�)�DefaultImpl)�Computed)�Identityrrz
Function[Any]c��eZdZdZ	d
dd	�ZdS)�
AlterTablez�Represent an ALTER TABLE statement.

    Only the string name and optional schema name of the table
    is required, not a full Table object.

    N�
table_name�str�schema�!Optional[Union[quoted_name, str]]�return�Nonec�"�||_||_dS�N)r!r#)�selfr!r#s   �G/opt/cloudlinux/venv/lib64/python3.11/site-packages/alembic/ddl/base.py�__init__zAlterTable.__init__0s��
%��������r()r!r"r#r$r%r&)�__name__�
__module__�__qualname__�__doc__r+�r,r*r r 's<��������59�������r,r c�$��eZdZ	dd�fd
�
Z�xZS)
�RenameTableN�old_table_namer"�new_table_name�Union[quoted_name, str]r#r$r%r&c�\��t���||���||_dS�N)r#)�superr+r5)r)r4r5r#�	__class__s    �r*r+zRenameTable.__init__:s0���	��������7�7�7�,����r,r()r4r"r5r6r#r$r%r&�r-r.r/r+�
__classcell__�r:s@r*r3r39sG�������
59�	-�-�-�-�-�-�-�-�-�-�-r,r3c�,��eZdZ					dd�fd�
Z�xZS)�AlterColumnN�namer"�column_namer#�
Optional[str]�
existing_type�Optional[TypeEngine]�existing_nullable�Optional[bool]�existing_server_default�Optional[_ServerDefault]�existing_commentr%r&c���t���||���||_|�tj|��nd|_||_||_||_dSr8)	r9r+rA�sqltypes�to_instancerCrErGrI)	r)r@rAr#rCrErGrIr:s	        �r*r+zAlterColumn.__init__Esp���	������f��-�-�-�&����(�
� ��/�/�/��	
��
"3���'>��$� 0����r,)NNNNN)r@r"rAr"r#rBrCrDrErFrGrHrIrBr%r&r;r=s@r*r?r?DsS�������
!%�.2�,0�<@�*.�1�1�1�1�1�1�1�1�1�1�1r,r?c� ��eZdZd	�fd�Z�xZS)
�ColumnNullabler@r"rA�nullable�boolr%r&c�L��t��j||fi|��||_dSr()r9r+rO)r)r@rArO�kwr:s     �r*r+zColumnNullable.__init__\s1���	������{�1�1�b�1�1�1� ��
�
�
r,)r@r"rAr"rOrPr%r&r;r=s@r*rNrN[s=�������!�!�!�!�!�!�!�!�!�!r,rNc� ��eZdZd	�fd�Z�xZS)
�
ColumnTyper@r"rA�type_rr%r&c�p��t��j||fi|��tj|��|_dSr()r9r+rKrLrU)r)r@rArUrRr:s     �r*r+zColumnType.__init__ds<���	������{�1�1�b�1�1�1��)�%�0�0��
�
�
r,)r@r"rAr"rUrr%r&r;r=s@r*rTrTcs=�������1�1�1�1�1�1�1�1�1�1r,rTc� ��eZdZd�fd�Z�xZS)	�
ColumnNamer@r"rA�newnamer%r&c�L��t��j||fi|��||_dSr()r9r+rY)r)r@rArYrRr:s     �r*r+zColumnName.__init__l�1���	������{�1�1�b�1�1�1�����r,)r@r"rAr"rYr"r%r&r;r=s@r*rXrXk�=����������������r,rXc� ��eZdZd	�fd�Z�xZS)
�
ColumnDefaultr@r"rA�defaultrHr%r&c�L��t��j||fi|��||_dSr(�r9r+r_�r)r@rAr_rRr:s     �r*r+zColumnDefault.__init__ts1���	������{�1�1�b�1�1�1�����r,)r@r"rAr"r_rHr%r&r;r=s@r*r^r^ss=����������������r,r^c� ��eZdZd	�fd�Z�xZS)
�ComputedColumnDefaultr@r"rAr_�Optional[Computed]r%r&c�L��t��j||fi|��||_dSr(rarbs     �r*r+zComputedColumnDefault.__init__�r[r,)r@r"rAr"r_rer%r&r;r=s@r*rdrdr\r,rdc� ��eZdZd�fd
�Z�xZS)�IdentityColumnDefaultr@r"rAr_�Optional[Identity]�implrr%r&c�Z��t��j||fi|��||_||_dSr()r9r+r_rj)r)r@rAr_rjrRr:s      �r*r+zIdentityColumnDefault.__init__�s8���	������{�1�1�b�1�1�1������	�	�	r,)
r@r"rAr"r_rirjrr%r&r;r=s@r*rhrh�s=�������
�
�
�
�
�
�
�
�
�
r,rhc�$��eZdZ	dd�fd
�
Z�xZS)
�	AddColumnNr@r"�column�Column[Any]r#r$r%r&c�\��t���||���||_dSr8�r9r+rn�r)r@rnr#r:s    �r*r+zAddColumn.__init__�s-���	������f��-�-�-�����r,r()r@r"rnror#r$r%r&r;r=s@r*rmrm�sG�������
59�	����������r,rmc�$��eZdZ	dd�fd
�
Z�xZS)
�
DropColumnNr@r"rnror#rBr%r&c�\��t���||���||_dSr8rqrrs    �r*r+zDropColumn.__init__�s-���	������f��-�-�-�����r,r()r@r"rnror#rBr%r&r;r=s@r*rtrt�sE�������FJ�����������r,rtc� ��eZdZd	�fd�Z�xZS)
�
ColumnCommentr@r"rA�commentrBr%r&c�L��t��j||fi|��||_dSr()r9r+rx)r)r@rArxrRr:s     �r*r+zColumnComment.__init__�r[r,)r@r"rAr"rxrBr%r&r;r=s@r*rwrw�r\r,rw�element�compilerrr%r"c�t�t||j|j���dt||j|j����S)Nz RENAME TO )�alter_tabler!r#�format_table_namer5�rzr{rRs   r*�visit_rename_tabler��s?��
	�H�g�0�'�.�A�A�A�A��(�G�$:�G�N�K�K�K��r,c�d�t||j|j���dt||jfi|����S�N� )r}r!r#�
add_columnrnrs   r*�visit_add_columnr��sB��	�H�g�0�'�.�A�A�A�A��8�W�^�2�2�r�2�2�2��r,c�n�t||j|j���dt||jjfi|����Sr�)r}r!r#�drop_columnrnr@rs   r*�visit_drop_columnr��sE��	�H�g�0�'�.�A�A�A�A��H�g�n�1�8�8�R�8�8�8��r,c��t||j|j���dt||j���d|jrdnd��S)Nr�z
DROP NOT NULLzSET NOT NULL)r}r!r#�alter_columnrArOrs   r*�visit_column_nullabler��sP��
	�H�g�0�'�.�A�A�A�A��X�w�2�3�3�3�3�"�+�?����?��r,c	��t||j|j���dt||j���ddt||j��z��S)Nr�zTYPE %s)r}r!r#r�rA�format_typerUrs   r*�visit_column_typer��sU��	�H�g�0�'�.�A�A�A�A��X�w�2�3�3�3�3��K��'�-�8�8�8�8��r,c��t||j|j���dt||j���dt||j����S)Nz RENAME z TO )r}r!r#�format_column_namerArYrs   r*�visit_column_namer��sP��	�H�g�0�'�.�A�A�A�A��8�W�%8�9�9�9�9��8�W�_�5�5�5��r,c	��t||j|j���dt||j���d|j�dt
||j��znd��S)Nr�zSET DEFAULT %szDROP DEFAULT)r}r!r#r�rAr_�format_server_defaultrs   r*�visit_column_defaultr��sh��
	�H�g�0�'�.�A�A�A�A��X�w�2�3�3�3�3��?�&�	�0��7�?�K�K�K�K�
�	��r,c�*�tjd���)NztAdding or removing a "computed" construct, e.g. GENERATED ALWAYS AS, to or from an existing column is not supported.�r�CompileErrorrs   r*�visit_computed_columnr��s���
�	E���r,c�*�tjd���)Nz�Adding, removing or modifying an "identity" construct, e.g. GENERATED AS IDENTITY, to or from an existing column is not supported in this dialect.r�rs   r*�visit_identity_columnr��s���
�	3���r,r@r6�quote�functools.partialc���t|t��r�|��Sd��fd�|�d��D����}|S)z#quote the elements of a dotted name�.c�&��g|]
}�|����Sr1r1)�.0�xr�s  �r*�
<listcomp>z quote_dotted.<locals>.<listcomp>s!���9�9�9�A�u�u�Q�x�x�9�9�9r,)�
isinstancer
�join�split)r@r��results ` r*�quote_dottedr�	sZ���
�$��$�$���u�T�{�{��
�X�X�9�9�9�9����C���9�9�9�
:�
:�F��Mr,rr#r$c��tj|jj��}|rt	||��dz||��zS||��S)Nr�)�	functools�partial�preparerr�r�)r{r@r#r�s    r*r~r~sR��

��h�/�5�6�6�E�
���F�E�*�*�S�0�5�5��;�;�>�>��u�T�{�{�r,c�6�|j�|��Sr()r�r��r{r@s  r*r�r� s����"�"�4�(�(�(r,r_rHc�V�|�tdt|�����S)Nr�)�server_default)�get_column_default_stringrr)r{r_s  r*r�r�&s.���-�-��s�G�G�4�4�4���r,rUrc�@�|jj�|��Sr()�dialect�
type_compiler�process)r{rUs  r*r�r�/s����)�1�1�%�8�8�8r,rBc�*�dt|||��zS)NzALTER TABLE %s)r~)r{r@r#s   r*r}r}3s��
�/��$��G�G�G�Gr,c�(�dt||��zS)NzDROP COLUMN %s�r�)r{r@rRs   r*r�r�;s���0��4�@�@�@�@r,c�(�dt||��zS)NzALTER COLUMN %sr�r�s  r*r�r�?s���1�(�D�A�A�A�Ar,rnroc���d�j|fi|��z}d��fd�|jD����}|r|d|zz
}|S)Nz
ADD COLUMN %sr�c3�B�K�|]}��|��V��dSr()r�)r��
constraintr{s  �r*�	<genexpr>zadd_column.<locals>.<genexpr>FsB�������)3�����$�$������r,)�get_column_specificationr��constraints)r{rnrR�text�consts`    r*r�r�Cs|����>�X�>�v�L�L��L�L�L�D��H�H�����7=�7I����
�
�E�
����e�����Kr,)rzr3r{rr%r")rzrmr{rr%r")rzrtr{rr%r")rzrNr{rr%r")rzrTr{rr%r")rzrXr{rr%r")rzr^r{rr%r")rzrdr{r)rzrhr{r)r@r6r�r�r%r6)r{rr@r6r#r$r%r6)r{rr@r$r%r6)r{rr_rHr%r")r{rrUrr%r")r{rr@r"r#rBr%r")r{rr@r"r%r")r{rrnror%r")H�
__future__rr��typingrrr�
sqlalchemyrrr	rK�sqlalchemy.ext.compilerr
�sqlalchemy.schemarr�sqlalchemy.sql.elementsr
�util.sqla_compatrrrrrr�sqlalchemy.sql.compilerrrr�sqlalchemy.sql.functionsr�sqlalchemy.sql.schemar�sqlalchemy.sql.type_apirrjrrrr"�_ServerDefaultr r3r?rNrTrXr^rdrhrmrtrwr�r�r�r�r�r�r�r�r�r�r~r�r�r�r}r�r�r�r1r,r*�<module>r�sG��"�"�"�"�"�"����������� � � � � � �������������������(�(�(�(�(�(�,�,�,�,�,�,�$�$�$�$�$�$�(�(�(�(�(�(�/�/�/�/�/�/�6�6�6�6�6�6�,�,�,�,�,�,�'�'�'�'�'�'�-�-�-�-�-�-�4�4�4�4�4�4��,�������0�0�0�0�0�0�3�3�3�3�3�3�2�2�2�2�2�2�1�1�1�1�1�1�2�2�2�2�2�2�2�2�2�2�2�2�!�!�!�!�!�!�+�+�+�+�+�+�+�+�+�+�+�+��|�^�_�c�I�J�����������$-�-�-�-�-�*�-�-�-�1�1�1�1�1�*�1�1�1�.!�!�!�!�!�[�!�!�!�1�1�1�1�1��1�1�1����������	�	�	�	�	�K�	�	�	������K���������K���������
������������������K����
��+���������
��)���������
��*���������
��.���������
��*���������
��*���������
��-���	�	�	���	�
��
� � ����!� ��
��
� � ����!� ������	�	�	�	�)�)�)�)�����9�9�9�9�H�H�H�H�A�A�A�A�B�B�B�B�	�	�	�	�	�	r,

Zerion Mini Shell 1.0