
    [hq                        d dl mZ d dl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gZi ZddZd Zd Zd Z G d d          Z G d d          Z G d d          Zd Zd ZdS )    )annotationsN   )config)
exclusions   )event)schema)types)mapped_column)OrderedDictTableColumnreturnschema.Tablec                    fdt                    D             }                    t                     t          j        t
          j        d          r dvrdvrdvrd|v sd|v rdd<   nDd	d<   n>t          j        t
          j        d
          rdvrdvrdvrd|v sd|v rdd<   nd	d<   t          j        | i S )z8A schema.Table wrapper/hook for dialect-specific tweaks.c                f    i | ]-}|                     d           |                    |          .S test_
startswithpop.0kkws     h/var/www/api.easyaligner.net/htdocs/venv_linux/lib/python3.11/site-packages/sqlalchemy/testing/schema.py
<dictcomp>zTable.<locals>.<dictcomp>   6    III!1<<3H3HIBFF1IIIII    mysqlmysql_engine
mysql_typeautoload_withtest_needs_fktest_needs_acidInnoDBMyISAMmariadbmariadb_enginemariadb_type)	listupdatetable_optionsr   againstr   _currentr	   r   )argsr   	test_optss    ` r   r   r      s    JIIItBxxIIIIIIm&/733 0"$$B&&r)))++/@I/M/M%->"" &.>"		FOY	7	7 	0B&&b((r)))++/@I/M/M'/#$$'/#$<$$$$r   c                 .    t          t          | |          S )z>An orm.mapped_column wrapper/hook for dialect-specific tweaks.)_schema_column_orm_mapped_columnr0   r   s     r   r   r   ?   s     ,dB777r   c                 8    t          t          j        | |          S )z9A schema.Column wrapper/hook for dialect-specific tweaks.)r3   r	   r   r5   s     r   r   r   E   s     &-r222r   c                   fdt                    D             }t          j        j                            t                    sd |D             } | |i }| t
          j        u r|}n|j        }|                    dd          ro                    dd          rY|j	        |j
        d|_        d|j        d<   t          j        t          j        d          rd }t!          j        |d	|d
           |S )Nc                f    i | ]-}|                     d           |                    |          .S r   r   r   s     r   r   z"_schema_column.<locals>.<dictcomp>L   r   r   c                F    g | ]}t          |t          j                  |S  )
isinstancer	   
ForeignKey)r   args     r   
<listcomp>z"_schema_column.<locals>.<listcomp>O   s*    NNN:c6;L+M+MNNNNr   test_needs_autoincrementFprimary_keyToraclec           	         |                      t          j        t          t          j        j        |j        dz   | j        z   dz             d                     d S )N__seqT)optional)_init_itemsr	   Sequence_truncate_namer   dbdialectname)ctbls     r   add_seqz_schema_column.<locals>.add_seqe   sd    O&"I-sx#~/F/O  "&	      r   after_parent_attach)	propagate)r+   r   requirementsforeign_key_ddlenabled_for_configr	   r   columngetdefaultserver_defaultautoincrementinfor   r.   r/   r   listen)factoryr0   r   r1   	constructcolrN   s     `    r   r3   r3   K   s)   IIIItBxxIIII.AA&II ONNtNNN$$$I&-}}/77 NBFFu= = N ;3#5#= $C 04+, fox88 	N   L3WMMMMr   c                  $    e Zd ZdZd Zd Zd ZdS )eq_type_affinitya  Helper to compare types inside of datastructures based on affinity.

    E.g.::

        eq_(
            inspect(connection).get_columns("foo"),
            [
                {
                    "name": "id",
                    "type": testing.eq_type_affinity(sqltypes.INTEGER),
                    "nullable": False,
                    "default": None,
                    "autoincrement": False,
                },
                {
                    "name": "data",
                    "type": testing.eq_type_affinity(sqltypes.NullType),
                    "nullable": True,
                    "default": None,
                    "autoincrement": False,
                },
            ],
        )

    c                8    t          j        |          | _        d S N)sqltypesto_instancetargetselfrd   s     r   __init__zeq_type_affinity.__init__   s    *622r   c                (    | j         j        |j        u S ra   rd   _type_affinityrf   others     r   __eq__zeq_type_affinity.__eq__   s    {)U-AAAr   c                (    | j         j        |j        uS ra   ri   rk   s     r   __ne__zeq_type_affinity.__ne__   s    {)1EEEr   N__name__
__module____qualname____doc__rg   rm   ro   r:   r   r   r_   r_   s   sS         43 3 3B B BF F F F Fr   r_   c                  $    e Zd ZdZd Zd Zd ZdS )eq_compile_typez,similar to eq_type_affinity but uses compilec                    || _         d S ra   rd   re   s     r   rg   zeq_compile_type.__init__       r   c                <    | j         |                                k    S ra   rd   compilerk   s     r   rm   zeq_compile_type.__eq__       {emmoo--r   c                <    | j         |                                k    S ra   r{   rk   s     r   ro   zeq_compile_type.__ne__   r}   r   Nrp   r:   r   r   rv   rv      sG        66  . . .. . . . .r   rv   c                  $    e Zd ZdZd Zd Zd ZdS )eq_clause_elementz3Helper to compare SQL structures based on compare()c                    || _         d S ra   rx   re   s     r   rg   zeq_clause_element.__init__   ry   r   c                6    | j                             |          S ra   rd   comparerk   s     r   rm   zeq_clause_element.__eq__   s    {""5)))r   c                8    | j                             |           S ra   r   rk   s     r   ro   zeq_clause_element.__ne__   s    ;&&u----r   Nrp   r:   r   r   r   r      sG        ==  * * *. . . . .r   r   c                    t          |          | j        k    rK|dt          | j        dz
  d                   dz   t          t	          |          dz            dd          z   S |S )Nr      rC   @   r   )lenmax_identifier_lengthmaxhexhash)rJ   rK   s     r   rH   rH      sl    
4yy7000S6:A>>>?$t**r/""122&'	
 r   c                ,   t                      }dfd	}i t          fd            }t          | t          f|||d          }	 t	          j        d          j                            dd          }n# t          t          f$ r Y nw xY w|||_
        |S )Nc                    || _         || _        | | j        |<   | |<   t          | j        ||            |r"| | j        |<   t          | j        ||            d S d S ra   )rK   value__members__setattr	__class__)rf   rK   r   aliasvalue_to_members       r   rg   zpep435_enum.<locals>.__init__   su    	
!%!%d+++ 	1&*DU#DNE400000	1 	1r   c                    |         S ra   r:   )clsr   r   s     r   rU   zpep435_enum.<locals>.get   s    u%%r   )r   rg   rU   r   rq   __main__ra   )r   classmethodtypeobjectsys	_getframe	f_globalsrU   AttributeError
ValueErrorrr   )rK   r   rg   rU   someenummoduler   s         @r   pep435_enumr      s    --K1 1 1 1 1 1 O& & & & [& 		##FF Hq!!+//
JGGJ'   $Os   -A4 4BB)r   r   )
__future__r   r    r   r   r   r	   r
   rb   ormr   r4   utilr   __all__r-   r   r   r3   r_   rv   r   rH   r   r:   r   r   <module>r      s   # " " " " " 



                                     5 5 5 5 5 5      H
"% "% "% "%J8 8 83 3 3% % %P"F "F "F "F "F "F "F "FJ
. 
. 
. 
. 
. 
. 
. 
.
. 
. 
. 
. 
. 
. 
. 
.  # # # # #r   