Hacked By AnonymousFox

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

�

�܋f�����dZddlmZddlmZddlmZddlmZddlmZddlmZdd	lm	Z
dd
lmZddlm
Z
ddlmZejd
���ZGd�de��ZdS)a�Provides an abstraction for obtaining database schema information.

Usage Notes:

Here are some general conventions when accessing the low level inspector
methods such as get_table_names, get_columns, etc.

1. Inspector methods return lists of dicts in most cases for the following
   reasons:

   * They're both standard types that can be serialized.
   * Using a dict instead of a tuple allows easy expansion of attributes.
   * Using a list for the outer structure maintains order and is easy to work
     with (e.g. list comprehension [d['name'] for d in cols]).

2. Records that contain a name, such as the column name in a column record
   use the key 'name'. So for most return values, each record will have a
   'name' attribute..
�)�Connectable�)�exc)�
inspection)�sql)�util)�	operators)�schema)�
TypeEngine)�
deprecated)�topologicalc�6�|�dd��}|�
|||g|�Ri|��S|jtd�|D����td�|���D����f}|�|��}|�|||g|�Ri|��}|||<|S)N�
info_cachec3�NK�|] }t|tj���|V��!dS�N)�
isinstancer�string_types)�.0�as  �S/opt/cloudlinux/venv/lib64/python3.11/site-packages/sqlalchemy/engine/reflection.py�	<genexpr>zcache.<locals>.<genexpr>/s4����
B�
B�A��A�t�/@�!A�!A�
B�a�
B�
B�
B�
B�
B�
B�c3�0K�|]\}}|dk�||fV��dS)rN�)r�k�vs   rrzcache.<locals>.<genexpr>0s4����
A�
A���A�q�L�/@�/@�q�!�f�/@�/@�/@�/@�
A�
Ar)�get�__name__�tuple�items)�fn�self�con�args�kwr�key�rets        r�cacher((s�������d�+�+�J����r�$��)�d�)�)�)�b�)�)�)�
��
�
B�
B��
B�
B�
B�B�B�
�
A�
A������
A�
A�
A�A�A��C�
�.�.��
�
�C�
�{��b��s�(�T�(�(�(�R�(�(���
�3���Jrc���eZdZdZd�Zed���Zeje	��d���Z
ed���Zd�Z
ejd���d*d
���Zd+d�Zd�Zd
�Zd+d�Zd+d�Zd+d�Zd+d�Zedd��d+d���Zd+d�Zd+d�Zd+d�Zd+d�Zd+d�Zd+d�Z			d,d�Z d�Z!d�Z"d �Z#d!�Z$d"e%j&fd#e%j'fd$e%j(fd%e%j)fgZ*d&�Z+d'�Z,d(�Z-d)�Z.d	S)-�	Inspectora�Performs database schema inspection.

    The Inspector acts as a proxy to the reflection methods of the
    :class:`~sqlalchemy.engine.interfaces.Dialect`, providing a
    consistent interface as well as caching support for previously
    fetched metadata.

    A :class:`_reflection.Inspector` object is usually created via the
    :func:`_sa.inspect` function::

        from sqlalchemy import inspect, create_engine
        engine = create_engine('...')
        insp = inspect(engine)

    The inspection method above is equivalent to using the
    :meth:`_reflection.Inspector.from_engine` method, i.e.::

        engine = create_engine('...')
        insp = Inspector.from_engine(engine)

    Where above, the :class:`~sqlalchemy.engine.interfaces.Dialect` may opt
    to return an :class:`_reflection.Inspector`
    subclass that provides additional
    methods specific to the dialect's target database.

    c���||_t|d��r
|j|_n||_|j|ur&|������|jj|_i|_dS)a�Initialize a new :class:`_reflection.Inspector`.

        :param bind: a :class:`~sqlalchemy.engine.Connectable`,
          which is typically an instance of
          :class:`~sqlalchemy.engine.Engine` or
          :class:`~sqlalchemy.engine.Connection`.

        For a dialect-specific instance of :class:`_reflection.Inspector`, see
        :meth:`_reflection.Inspector.from_engine`

        �engineN)�bind�hasattrr,�connect�close�dialectr)r"r-s  r�__init__zInspector.__init__Uso����	��4��"�"�	��+�D�K�K��D�K��;�$����L�L�N�N� � �"�"�"��{�*�������rc�~�t|jd��r|j�|��St|��S)a�Construct a new dialect-specific Inspector object from the given
        engine or connection.

        :param bind: a :class:`~sqlalchemy.engine.Connectable`,
          which is typically an instance of
          :class:`~sqlalchemy.engine.Engine` or
          :class:`~sqlalchemy.engine.Connection`.

        This method differs from direct a direct constructor call of
        :class:`_reflection.Inspector` in that the
        :class:`~sqlalchemy.engine.interfaces.Dialect` is given a chance to
        provide a dialect-specific :class:`_reflection.Inspector` instance,
        which may
        provide additional methods.

        See the example at :class:`_reflection.Inspector`.

        �	inspector)r.r1r4r*)�clsr-s  r�from_enginezInspector.from_engineqs:��(�4�<��-�-�	0��<�)�)�$�/�/�/�����rc�6�t�|��Sr)r*r6)r-s r�_inspzInspector._insp�s���$�$�T�*�*�*rc��|jjS)z�Return the default schema name presented by the dialect
        for the current engine's database user.

        E.g. this is typically ``public`` for PostgreSQL and ``dbo``
        for SQL Server.

        )r1�default_schema_name�r"s rr:zInspector.default_schema_name�s���|�/�/rc�|�t|jd��r&|j�|j|j���SgS)zReturn all schema names.�get_schema_names�r)r.r1r=r-rr;s rr=zInspector.get_schema_names�sH���4�<�!3�4�4�	��<�0�0��	�d�o�1���
��	r)z1.0a	The :paramref:`get_table_names.order_by` parameter is deprecated and will be removed in a future release.  Please refer to :meth:`_reflection.Inspector.get_sorted_table_and_fkc_names` for a more comprehensive solution to resolving foreign key cycles between tables.)�order_byNc��t|jd��r(|j�|j||j���}n|j�|��}|dkrkg}|D]D}|�||��D]+}||dkr|�|d|f���,�Ettj||����}|S)a�Return all table names in referred to within a particular schema.

        The names are expected to be real tables only, not views.
        Views are instead returned using the
        :meth:`_reflection.Inspector.get_view_names`
        method.


        :param schema: Schema name. If ``schema`` is left at ``None``, the
         database's default schema is
         used, else the named schema is searched.  If the database does not
         support named schemas, behavior is undefined if ``schema`` is not
         passed as ``None``.  For special quoting, use :class:`.quoted_name`.

        :param order_by: Optional, may be the string "foreign_key" to sort
         the result on foreign key dependencies.  Does not automatically
         resolve cycles, and will raise :class:`.CircularDependencyError`
         if cycles exist.

        .. seealso::

            :meth:`_reflection.Inspector.get_sorted_table_and_fkc_names`

            :attr:`_schema.MetaData.sorted_tables`

        �get_table_namesr>�foreign_key�referred_table)r.r1rAr-rr,�table_names�get_foreign_keys�append�listr
�sort)r"r
r?�tnames�tuples�tname�fkeys       rrAzInspector.get_table_names�s���N�4�<�!2�3�3�	5��\�1�1��	�6�d�o�2���F�F��[�,�,�V�4�4�F��}�$�$��F��
G�
G�� �1�1�%��@�@�G�G�D���%5� 6�6�6��
�
�t�,<�'=�u�&E�F�F�F��G��+�*�6�6�:�:�;�;�F��
rc�\�	�
��t|jd��r(|j�|j||j���}n|j�|��}t��}t���i�
|D]b}|�||��}td�|D�����
|<|D]+}||dkr|�	|d|f���,�c	ttj||����}n�#tj$rx}|jD]D�	|��	�����	fd��
�	dD�����Ettj||����}Yd}~nd}~wwxYw�
�fd�|D��dt���fgzS)	a�Return dependency-sorted table and foreign key constraint names in
        referred to within a particular schema.

        This will yield 2-tuples of
        ``(tablename, [(tname, fkname), (tname, fkname), ...])``
        consisting of table names in CREATE order grouped with the foreign key
        constraint names that are not detected as belonging to a cycle.
        The final element
        will be ``(None, [(tname, fkname), (tname, fkname), ..])``
        which will consist of remaining
        foreign key constraint names that would require a separate CREATE
        step after-the-fact, based on dependencies between tables.

        .. versionadded:: 1.0.-

        .. seealso::

            :meth:`_reflection.Inspector.get_table_names`

            :func:`.sort_tables_and_constraints` - similar method which works
            with an already-given :class:`_schema.MetaData`.

        rAr>c��g|]
}|d��S)�namer)r�fks  r�
<listcomp>z<Inspector.get_sorted_table_and_fkc_names.<locals>.<listcomp>�s��+G�+G�+G�2�B�v�J�+G�+G�+GrrCc3�,�K�|]}�d|fV��dS)rNr)r�fkc�edges  �rrz;Inspector.get_sorted_table_and_fkc_names.<locals>.<genexpr>s<�����&�&�'*�T�!�W�c�N�&�&�&�&�&�&rrNc�J��g|]}|�|����f�� Sr)�
difference)rrK�fknames_for_table�remaining_fkcss  ��rrQz<Inspector.get_sorted_table_and_fkc_names.<locals>.<listcomp>
sB���
�
�
���%�e�,�7�7��G�G�H�
�
�
r)r.r1rAr-rr,rD�setrE�addrGr
rHr�CircularDependencyError�edges�remove�update)r"r
rIrJrK�fkeysrL�candidate_sort�errrTrWrXs         @@@r�get_sorted_table_and_fkc_namesz(Inspector.get_sorted_table_and_fkc_names�s)�����0�4�<�!2�3�3�	5��\�1�1��	�6�d�o�2���F�F��[�,�,�V�4�4�F������������	@�	@�E��)�)�%��8�8�E�'*�+G�+G��+G�+G�+G�'H�'H��e�$��
@�
@���D�!1�2�2�2��J�J��%5� 6��>�?�?�?��
@�		D�!�+�"2�6�6�"B�"B�C�C�N�N���*�	D�	D�	D��	�
�
���
�
�d�#�#�#��%�%�&�&�&�&�.?��Q��.H�&�&�&�����"�+�"2�6�6�"B�"B�C�C�N�N�N�N�N�N�����	D����
�
�
�
�
�'�
�
�
��D��(�(�
)�*�+�	+s�"D�F	�A.F�F	c�N�|j�|j|j���S)z�Return a list of temporary table names for the current bind.

        This method is unsupported by most dialects; currently
        only SQLite implements it.

        .. versionadded:: 1.0.0

        r>)r1�get_temp_table_namesr-rr;s rrdzInspector.get_temp_table_namess,���|�0�0��I�$�/�1�
�
�	
rc�N�|j�|j|j���S)z�Return a list of temporary view names for the current bind.

        This method is unsupported by most dialects; currently
        only SQLite implements it.

        .. versionadded:: 1.0.0

        r>)r1�get_temp_view_namesr-rr;s rrfzInspector.get_temp_view_namess,���|�/�/��I�$�/�0�
�
�	
rc�r�t|jd��r!|jj|j||fd|ji|��SiS)a�Return a dictionary of options specified when the table of the
        given name was created.

        This currently includes some options that apply to MySQL tables.

        :param table_name: string name of the table.  For special quoting,
         use :class:`.quoted_name`.

        :param schema: string schema name; if omitted, uses the default schema
         of the database connection.  For special quoting,
         use :class:`.quoted_name`.

        �get_table_optionsr)r.r1rhr-r�r"�
table_namer
r%s    rrhzInspector.get_table_options)sY���4�<�!4�5�5�	�1�4�<�1��	�:�v���:>�/��MO���
��	rc�P�|j�|j||j���S)z�Return all view names in `schema`.

        :param schema: Optional, retrieve names from a non-default schema.
         For special quoting, use :class:`.quoted_name`.

        r>)r1�get_view_namesr-r)r"r
s  rrlzInspector.get_view_names=s.���|�*�*��I�v�$�/�+�
�
�	
rc�R�|j�|j|||j���S)z�Return definition for `view_name`.

        :param schema: Optional, retrieve names from a non-default schema.
         For special quoting, use :class:`.quoted_name`.

        r>)r1�get_view_definitionr-r)r"�	view_namer
s   rrnzInspector.get_view_definitionIs0���|�/�/��I�y�&�T�_�0�
�
�	
rc��|jj|j||fd|ji|��}|D],}|d}t	|t
��s
|��|d<�-|S)a�Return information about columns in `table_name`.

        Given a string `table_name` and an optional string `schema`, return
        column information as a list of dicts with these keys:

        * ``name`` - the column's name

        * ``type`` - the type of this column; an instance of
          :class:`~sqlalchemy.types.TypeEngine`

        * ``nullable`` - boolean flag if the column is NULL or NOT NULL

        * ``default`` - the column's server default value - this is returned
          as a string SQL expression.

        * ``autoincrement`` - indicates that the column is auto incremented -
          this is returned as a boolean or 'auto'

        * ``comment`` - (optional) the comment on the column. Only some
          dialects return this key

        * ``computed`` - (optional) when present it indicates that this column
          is computed by the database. Only some dialects return this key.
          Returned as a dict with the keys:

          * ``sqltext`` - the expression used to generate this column returned
            as a string SQL expression

          * ``persisted`` - (optional) boolean that indicates if the column is
            stored in the table

          .. versionadded:: 1.3.16 - added support for computed reflection.

        * ``dialect_options`` - (optional) a dict with dialect specific options


        :param table_name: string name of the table.  For special quoting,
         use :class:`.quoted_name`.

        :param schema: string schema name; if omitted, uses the default schema
         of the database connection.  For special quoting,
         use :class:`.quoted_name`.

        :return: list of dictionaries, each representing the definition of
         a database column.

        r�type)r1�get_columnsr-rrr)r"rjr
r%�col_defs�col_def�coltypes       rrrzInspector.get_columnsUs|��b,�4�<�+��I�z�6�
�
�6:�o�
�IK�
�
�� �	,�	,�G��f�o�G��g�z�2�2�
,�")�'�)�)������rz0.7z�The :meth:`_reflection.Inspector.get_primary_keys` method is deprecated and will be removed in a future release.  Please refer to the :meth:`_reflection.Inspector.get_pk_constraint` method.c�P�|jj|j||fd|ji|��dS)z�Return information about primary keys in `table_name`.

        Given a string `table_name`, and an optional string `schema`, return
        primary key information as a list of column names.
        r�constrained_columns�r1�get_pk_constraintr-rris    r�get_primary_keyszInspector.get_primary_keys�sE��.�t�|�-��I�z�6�
�
�6:�o�
�IK�
�
�
�!�	!rc�D�|jj|j||fd|ji|��S)a�Return information about primary key constraint on `table_name`.

        Given a string `table_name`, and an optional string `schema`, return
        primary key information as a dictionary with these keys:

        * ``constrained_columns`` -
          a list of column names that make up the primary key

        * ``name`` -
          optional name of the primary key constraint.

        :param table_name: string name of the table.  For special quoting,
         use :class:`.quoted_name`.

        :param schema: string schema name; if omitted, uses the default schema
         of the database connection.  For special quoting,
         use :class:`.quoted_name`.

        rrxris    rryzInspector.get_pk_constraint�s=��(.�t�|�-��I�z�6�
�
�6:�o�
�IK�
�
�	
rc�D�|jj|j||fd|ji|��S)a�Return information about foreign_keys in `table_name`.

        Given a string `table_name`, and an optional string `schema`, return
        foreign key information as a list of dicts with these keys:

        * ``constrained_columns`` -
          a list of column names that make up the foreign key

        * ``referred_schema`` -
          the name of the referred schema

        * ``referred_table`` -
          the name of the referred table

        * ``referred_columns`` -
          a list of column names in the referred table that correspond to
          constrained_columns

        * ``name`` -
          optional name of the foreign key constraint.

        :param table_name: string name of the table.  For special quoting,
         use :class:`.quoted_name`.

        :param schema: string schema name; if omitted, uses the default schema
         of the database connection.  For special quoting,
         use :class:`.quoted_name`.

        r)r1rEr-rris    rrEzInspector.get_foreign_keys�s=��>-�t�|�,��I�z�6�
�
�6:�o�
�IK�
�
�	
rc�D�|jj|j||fd|ji|��S)aReturn information about indexes in `table_name`.

        Given a string `table_name` and an optional string `schema`, return
        index information as a list of dicts with these keys:

        * ``name`` -
          the index's name

        * ``column_names`` -
          list of column names in order

        * ``unique`` -
          boolean

        * ``column_sorting`` -
          optional dict mapping column names to tuple of sort keywords,
          which may include ``asc``, ``desc``, ``nullsfirst``, ``nullslast``.

          .. versionadded:: 1.3.5

        * ``dialect_options`` -
          dict of dialect-specific index options.  May not be present
          for all dialects.

          .. versionadded:: 1.0.0

        :param table_name: string name of the table.  For special quoting,
         use :class:`.quoted_name`.

        :param schema: string schema name; if omitted, uses the default schema
         of the database connection.  For special quoting,
         use :class:`.quoted_name`.

        r)r1�get_indexesr-rris    rr~zInspector.get_indexes�s>��H(�t�|�'��I�z�6�
�
�6:�o�
�IK�
�
�	
rc�D�|jj|j||fd|ji|��S)aReturn information about unique constraints in `table_name`.

        Given a string `table_name` and an optional string `schema`, return
        unique constraint information as a list of dicts with these keys:

        * ``name`` -
          the unique constraint's name

        * ``column_names`` -
          list of column names in order

        :param table_name: string name of the table.  For special quoting,
         use :class:`.quoted_name`.

        :param schema: string schema name; if omitted, uses the default schema
         of the database connection.  For special quoting,
         use :class:`.quoted_name`.

        r)r1�get_unique_constraintsr-rris    rr�z Inspector.get_unique_constraintss=��*3�t�|�2��I�z�6�
�
�6:�o�
�IK�
�
�	
rc�D�|jj|j||fd|ji|��S)a�Return information about the table comment for ``table_name``.

        Given a string ``table_name`` and an optional string ``schema``,
        return table comment information as a dictionary with these keys:

        * ``text`` -
            text of the comment.

        Raises ``NotImplementedError`` for a dialect that does not support
        comments.

        .. versionadded:: 1.2

        r)r1�get_table_commentr-rris    rr�zInspector.get_table_comments=�� .�t�|�-��I�z�6�
�
�6:�o�
�IK�
�
�	
rc�D�|jj|j||fd|ji|��S)acReturn information about check constraints in `table_name`.

        Given a string `table_name` and an optional string `schema`, return
        check constraint information as a list of dicts with these keys:

        * ``name`` -
          the check constraint's name

        * ``sqltext`` -
          the check constraint's SQL expression

        * ``dialect_options`` -
          may or may not be present; a dictionary with additional
          dialect-specific options for this CHECK constraint

          .. versionadded:: 1.3.8

        :param table_name: string name of the table.  For special quoting,
         use :class:`.quoted_name`.

        :param schema: string schema name; if omitted, uses the default schema
         of the database connection.  For special quoting,
         use :class:`.quoted_name`.

        .. versionadded:: 1.1.0

        r)r1�get_check_constraintsr-rris    rr�zInspector.get_check_constraints2s=��:2�t�|�1��I�z�6�
�
�6:�o�
�IK�
�
�	
rrTc
����|��|vrdS|����|jj}|j����}�j}t�fd�|jD����}	|j||fi�j��}
|
r��	|
��tjr^t|t��r|�|j��}t|t��r|�|j��}d}i}|j||fi�j��D]}
d}|��|
|||���|st%j�j���|�||�||��|�||�|||||	��|�||�||||	��|�||�||||	��|�||�||||	��|�||�|	��dS)aGiven a :class:`_schema.Table` object, load its internal
        constructs based on introspection.

        This is the underlying method used by most dialects to produce
        table reflection.  Direct usage is like::

            from sqlalchemy import create_engine, MetaData, Table
            from sqlalchemy.engine.reflection import Inspector

            engine = create_engine('...')
            meta = MetaData()
            user_table = Table('user', meta)
            insp = Inspector.from_engine(engine)
            insp.reflecttable(user_table, None)

        :param table: a :class:`~sqlalchemy.schema.Table` instance.
        :param include_columns: a list of string column names to include
          in the reflection process.  If ``None``, all columns are reflected.

        Nc3�b�K�|])}|�jv�|�j�|��fV��*dSr)�dialect_kwargsr)rr�tables  �rrz)Inspector.reflecttable.<locals>.<genexpr>�sS�����"
�"
���E�(�(�(���$�(�(��+�+�,�(�(�(�(�"
�"
rFT)rZr-r1�schema_for_objectrO�dict�reflection_optionsrhr��_validate_dialect_kwargsr�py2kr�str�decode�encodingrr�_reflect_columnr�NoSuchTableError�_reflect_pk�_reflect_fk�_reflect_indexes�_reflect_unique_constraints�_reflect_check_constraints�_reflect_table_comment)r"r��include_columns�exclude_columns�resolve_fks�
_extend_onr1r
rjr��tbl_opts�found_table�cols_by_orig_name�col_ds `            r�reflecttablezInspector.reflecttableSs����:�!��
�"�"������u�%�%�%��)�#����,�,�U�3�3���Z�
�"�"
�"
�"
�"
��/�"
�"
�"
�
�
��*�4�)���
�
�"'�"6�
�
���	5�
�*�*�8�4�4�4��9�	A��&�#�&�&�
9����w�'7�8�8���*�c�*�*�
A�'�.�.�w�/?�@�@�
�����%�T�%���
�
�"'�"6�
�
�	�	�E��K�� � �����!�
�
�
�
��	3��&�u�z�2�2�2�������'8�/�	
�	
�	
�	
�����������		
�		
�		
�	
����������	
�	
�	
�	
�(�(��������	
�	
�	
�	
�'�'��������	
�	
�	
�	
�#�#����'9�	
�	
�	
�	
�	
rc����d}|j�||����d}|r||vs|r||vrdS�d}t�fd�dD����}	d�vr|	��d��g}
��d�����d}t|tjj��rtj
|d���}nHt|tj��s.tj
t
j�d��d���}|
�
|��d	�vr,tjdi�d	��}|
�
|��d
�vr|��|
��tj||g|
�Ri|	��x||<}
|
j|jvrd|
_|�|
��dS)NrOrqc3�4�K�|]}|�v�|�|fV��dSrr)rrr�s  �rrz,Inspector._reflect_column.<locals>.<genexpr>�sA�����
�
���E�z�z���a��M��z�z�z�
�
r)�nullable�
autoincrement�quote�infor&�comment�dialect_options�defaultT)�
_reflected�computed�sequencer)�dispatch�column_reflectr�r^rrr�elements�
TextClause�	sa_schema�
DefaultClause�FetchedValue�textrF�Computed�_reflect_col_sequence�Columnr&�primary_key�
append_column)r"r�r�r�r�r��	orig_namerOru�col_kw�colargsr�r��cols  `           rr�zInspector._reflect_column�s/����&�M�	�
��%�%�d�E�5�9�9�9��V�}���	��O� ;� ;��!<� $�� 7� 7��F���-���
�
�
�
��
�
�
�
�
����%�%��M�M�%� 1�2�3�3�3����9�9�Y���+��I�&�G��'�3�<�#:�;�;�
�#�1�'�d�K�K�K������)?�@�@�
�#�1��H�U�9�-�.�.�4�����
�N�N�7�#�#�#����� �)�>�>�E�*�,=�>�>�H��N�N�8�$�$�$������&�&�u�g�6�6�6�-6�-=��'�.
�#�.
�.
�.
�'-�.
�.
�	
��)�$�s��7�e�'�'�'�"�C�O�
���C� � � � � rc���d|vr]|d}tj|ddd��}d|vr
|d|_d|vr
|d|_|�|��dSdS)Nr�rOr�start�	increment)r��Sequencer�r�rF)r"r�r��seqr�s     rr�zInspector._reflect_col_sequences{�������
�#�C� �)�#�f�+�q�!�<�<�H��#�~�~�!$�W�����c�!�!�%(��%5��"��N�N�8�$�$�$�$�$��rc�����|j||fi|j��}|rP��fd�|dD��}|�d��|j_|j�|��dSdS)Nc�0��g|]}|�v�|�v�
�|��Srr)r�pkr�r�s  ��rrQz)Inspector._reflect_pk.<locals>.<listcomp>(s>��������*�*�*�r��/H�/H�"�"�%�/H�/H�/HrrwrO)ryr�rr�rO�_reload)r"rjr
r�r�r��pk_cons�pk_colss    ``  rr�zInspector._reflect_pk!s�����)�$�(���
�
�"'�"6�
�
���	/������!�"7�8����G�&-�[�[��%8�%8�E��"�
��%�%�g�.�.�.�.�.�	/�	/rc		����|j||fi|j��}	|	D�]J}
|
d}�fd�|
dD��}|r#t|���|��r�D|
d}
|
d}|
d}g}|
�U|r"t	j||jfd|
|j|d�|��|D]-}|�d	�	|
||g�����.n]|r,t	j||jfd|jtj
|d
�|��|D],}|�d	�	||g�����-d|
vr	|
d}ni}|�t	j|||fddi|������LdS)
NrOc�6��g|]}|�vr
�|jn|��Sr)r&)r�cr�s  �rrQz)Inspector._reflect_fk.<locals>.<listcomp>GsB���#�#�#��-.�1B�,B�,B�!�!�$�(�(��#�#�#rrw�referred_schemarC�referred_columnsT)�autoloadr
�
autoload_withr��.)r�r�r
r��options�link_to_name)
rEr�rY�intersectionr��Table�metadatar-rF�join�BLANK_SCHEMA�append_constraint�ForeignKeyConstraint)r"rjr
r�r�r�r�r�r�r_�fkey_d�connamerwr�rCr��refspec�columnr�s    `              rr�zInspector._reflect_fk5sa���&��%���
�
�"'�"6�
�
���8	�8	�F��V�n�G�#�#�#�#�� 5�6�#�#�#���
�3�':�#;�#;�#H�#H��$�$�
��$�%6�7�O�#�$4�5�N�%�&8�9���G��*��	��O�&����"&�.�&*�i�#-�
��-����/���F��N�N����/�>�6�!J�K�K������
�	��O�&����"&�&*�i�(�5�#-�
��-����/�G�G�F��N�N�3�8�8�^�V�,D�#E�#E�F�F�F�F��F�"�"� ��+������#�#��.�'�����"&�	�
���
�
�
�
�a8	�8	r�asc�desc�
nullsfirst�	nullslastc��|�||��}|D�]�}	|	d}
|	d}|	�di��}|	d}
|	�dd��}|	�di��}|	�d��}|rQt|���|��s/t	jd	|�d
d�|���d�����|r��g}|D]�}	||vr||n|j|}n-#t$r t	j|�d
|�d|�d���Y�FwxYw|�|d��}|j	D]\}}||vr||��}�|�
|����tj|
g|�Rd|itt|�����d|
fgz�������dS)NrO�column_names�column_sorting�uniquerq�indexr��duplicates_constraintz	Omitting z
 key for (�, z), key covers omitted columns.z key '�(' was not located in columns for table '�'r�_table)r~rrY�issubsetr�warnr�r��KeyError�_index_sort_exprsrFr��Indexr�rGr )r"rjr
r�r�r�r�r��indexes�index_drO�columnsr�r��flavorr��
duplicates�idx_colsr��idx_col�	c_sortingr�ops                       rr�zInspector._reflect_indexes�sa���"�"�:�v�6�6���,	�,	�G��6�?�D��n�-�G�$�[�[�)9�2�>�>�N��X�&�F��[�[���1�1�F�%�k�k�*;�R�@�@�O� ���%<�=�=�J��
�s�7�|�|�'<�'<�_�'M�'M�
��	�	��v�v�t�y�y��1�1�1�1�3������
���H��
)�
)���� 1�1�1�*�!�,�,�"�W�Q�Z��G��
 �����I�4:�F�F�A�A�A�z�z�z�K�����H�����+�.�.�q�"�5�5�	�!�3�.�.�E�A�r��I�~�~�"$�"�W�+�+�������(�(�(�(��O��
��
�
�
��
��t�O�1�1�3�3�4�4��6�8J�7K�K�L�L�	
�
�
�
�O,	�,	s�(D�'D,�+D,c
�Z�	|�||��}n#t$rYdSwxYw|D]�}	|	d}
|	d}|	�d��}|rMt|���|��s+tjdd�|��z���v|r�yg}
|D]\}	||vr||n|j|}|
�	|���2#t$rtjd|�d|�d���Y�YwxYw|�tj
|
d|
i�����dS)	NrOr��duplicates_indexzDOmitting unique constraint key for (%s), key covers omitted columns.r�zunique constraint key 'r�r�)r��NotImplementedErrorrrYr�rr�r�r�rFr�r�r��UniqueConstraint)r"rjr
r�r�r�r�r��constraints�const_dr�r�r��constrained_colsr��constrained_cols                rr�z%Inspector._reflect_unique_constraints�s���	��5�5�j�&�I�I�K�K��"�	�	�	��F�F�	����#�	�	�G��f�o�G��n�-�G� ���%7�8�8�J��
�s�7�|�|�'<�'<�_�'M�'M�
��	�2�48�I�I�g�4F�4F�G������
�� "���

=�

=��=�� 1�1�1�*�!�,�,�"�W�Q�Z�$�%�+�+�O�<�<�<�<��
 �����I�I�45�A�A�z�z�z�C����������
�#�#��*�,<�K�7�K�K�
�
�
�
�;	�	s��
'�'�,C�%D�Dc��	|�||��}n#t$rYdSwxYw|D]&}	|�tjdi|	�����'dS)Nr)r�r�r�r��CheckConstraint)
r"rjr
r�r�r�r�r�r�rs
          rr�z$Inspector._reflect_check_constraints�s���	��4�4�Z��H�H�K�K��"�	�	�	��F�F�	����#�	J�	J�G��#�#�I�$=�$H�$H��$H�$H�I�I�I�I�	J�	Js��
'�'c��	|�||��}|�dd��|_dS#t$rYdSwxYw)Nr�)r�rr�r�)r"rjr
r�r��comment_dicts      rr�z Inspector._reflect_table_comments]��	;��1�1�*�f�E�E�L�)�,�,�V�T�:�:�E�M�M�M��#�	�	�	��F�F�	���s�5�
A�A)NNr)rTN)/r�
__module__�__qualname__�__doc__r2�classmethodr6r�	_inspectsrr8�propertyr:r=r�deprecated_paramsrArbrdrfrhrlrnrrrrzryrEr~r�r�r�r�r�r�r�r�r	�asc_op�desc_op�
nullsfirst_op�nullslast_opr�r�r�r�r�rrrr*r*9s���������6���8����[��.�Z��+�&�&�+�+�'�&�+��0�0��X�0�����T��
�
�
�
�)�)�)�
�
�)�V6+�6+�6+�6+�p
�
�
�
�
�
�����(

�

�

�

�

�

�

�

�9�9�9�9�v�Z�
�	B���	!�	!�	!���	!�
�
�
�
�0!
�!
�!
�!
�F&
�&
�&
�&
�P
�
�
�
�2
�
�
�
�(
�
�
�
�J���
D
�D
�D
�D
�L;!�;!�;!�z	%�	%�	%�/�/�/�(F�F�F�R
�	� �!�	��"�#�	�y�.�/�	�i�,�-�	��8�8�8�t1�1�1�fJ�J�J�&;�;�;�;�;rr*N)r	�baser�rrrrr	r
r��sql.type_apirrr
�	decoratorr(�objectr*rrr�<module>rs ����(������������������������������������%�%�%�%�%�%�%�%�%�%�%�%���������������
�
���
� S;�S;�S;�S;�S;��S;�S;�S;�S;�S;r

Hacked By AnonymousFox1.0, Coded By AnonymousFox