
    ,h-'                   N   S r SSKJr  SSKrSSKJr  SSKJr  SSKJr  SSKJ	r	  SSK
Jr  SS	K
Jr  SS
K
Jr  SSK
Jr  SSK
Jr  SSK
Jr  SSK
Jr  SSK
Jr  SSK
Jr  SSK
Jr  SSK
Jr  SSK
Jr  SSK
Jr  SSK
Jr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJ r   SSKJ!r!  SSKJ"r#  SS K$J%r%  SS!K&J'r'  SS"K&J(r(  SS#K)J*r*  SS$K+J,r,  SS%K J-r-  SS&K.J/r/  \(       a6  SS'K0J1r1  SS(K0J2r2  SS)K0J3r3  SS*K0J4r4  SS+K0J5r5  SS,K0J6r6  SS-K0J7r7  SS.K0J8r8  SS/K0J9r9  \" S05      r:\ Rv                              S=S1 j5       r<    S>S2 jr=\	 " S3 S4\5      5       r>\	 " S5 S6\5      5       r?\R                   " S7 S8\R                  S8   5      5       rB\/ " S9 S:5      5       rC\ " S; S<5      5       rDg)?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..
    )annotationsN)	dataclass)auto)Flag)unique)Any)Callable)
Collection)Dict)	Generator)Iterable)List)Optional)Sequence)Set)Tuple)TYPE_CHECKING)TypeVar)Union   )
Connection)Engine   )exc)
inspection)sql)util)	operators)schema)_ad_hoc_cache_key_from_args)quoted_name)
TextClause)
TypeEngine)InternalTraversal)topological)final)Dialect)ReflectedCheckConstraint)ReflectedColumn)ReflectedForeignKeyConstraint)ReflectedIndex)ReflectedPrimaryKeyConstraint)ReflectedTableComment)ReflectedUniqueConstraint)TableKey_Rc                  ^ UR                  SS 5      nUc  U " X/UQ70 UD6$ SS1mU R                  [        S U 5       5      [        U4S jUR                  5        5       5      4nUR                  U5      nUc  U " X/UQ70 UD6nXuU'   U$ )N
info_cacheunreflectablec              3     #    U  HJ  n[        U[        5      (       d  M  [        U[        5      (       a  [        U5      UR                  4OUv   ML     g 7fN)
isinstancestrr!   quote).0as     T/var/www/auris/envauris/lib/python3.13/site-packages/sqlalchemy/engine/reflection.py	<genexpr>cache.<locals>.<genexpr>]   sB      
!S! CA{!;!;SVQWWBs
   A5Ac              3     >#    U  H?  u  pUT;  d  M  U[        U[        5      (       a  [        U5      UR                  4OU4v   MA     g 7fr5   )r6   r!   r7   r8   )r9   kvexcludes      r;   r<   r=   b   sE      
" HQZ;%?%?Q!QG"s
   A
7A
)get__name__tupleitems)	fnselfconargskwr2   keyretrA   s	           @r;   cacherM   O   s     d+J$)d)b))_-G
 

 	

 	 


 	
C nnS!C
{(T(R(3J    c                 V   ^  [         R                              SU 4S jj5       nU$ )Nc                   > UR                  SS 5      nUc  U " X/UQ70 UD6$ [        U R                  4TU5      nUR                  U5      nUc  U " X/UQ70 UD6nXuU'   U$ )Nr2   )rB   r    rC   )	rF   rG   rH   rI   rJ   r2   rK   rL   traverse_argss	           r;   goflexi_cache.<locals>.gor   sw     VVL$/
d-$-"--)2;;.-N..%;T,,,C!sO
rN   rF   zCallable[..., _R]rG   r'   rH   r   rI   r   rJ   r   returnr0   )r   	decorator)rQ   rR   s   ` r;   flexi_cacherW   o   sZ     
^^  	
  
 " IrN   c                  d    \ rS rSrSr\" 5       r \" 5       r \" 5       r \\-  r	 \\-  \-  r
Srg)
ObjectKind   a  Enumerator that indicates which kind of object to return when calling
the ``get_multi`` methods.

This is a Flag enum, so custom combinations can be passed. For example,
to reflect tables and plain views ``ObjectKind.TABLE | ObjectKind.VIEW``
may be used.

.. note::
  Not all dialect may support all kind of object. If a dialect does
  not support a particular object an empty dict is returned.
  In case a dialect supports an object, but the requested method
  is not applicable for the specified kind the default value
  will be returned for each reflected object. For example reflecting
  check constraints of view return a dict with all the views with
  empty lists as values.
 N)rC   
__module____qualname____firstlineno____doc__r   TABLEVIEWMATERIALIZED_VIEWANY_VIEWANY__static_attributes__r[   rN   r;   rY   rY      sH    " FE6D &''H&
$,*
*C!rN   rY   c                  B    \ rS rSrSr\" 5       r \" 5       r \\-  rSr	g)ObjectScope   zUEnumerator that indicates which scope to use when calling
the ``get_multi`` methods.
r[   N)
rC   r\   r]   r^   r_   r   DEFAULT	TEMPORARYrd   re   r[   rN   r;   rg   rg      s*     fGI
I
C)rN   rg   c                     \ rS rSr% SrS\S'   S\S'   S\S'   S	\S
'   S\S'   \R                  " SS5      SHS j5       r\	      SIS j5       r
SJS jrSKS jrSLS jrSMS jr\	\R                  " SS5      SNS j5       5       r\R"                  " \5      SNS j5       r\R"                  " \5      SOS j5       r\R.                  SPS j5       r\R.                  SQS j5       r\SRS j5       rSSS jr S$     STS jjr S$       SUS jjr S$       SVS  jjr S$         SWS! jjr SXS" jr! S$     SYS# jjr" SZ     S[S% jjr#SSS& jr$SSS' jr% S$       S\S( jjr&SS\'RP                  \)RT                  4           S]S) jjr+ S$     STS* jjr, S$     STS+ jjr- S$     STS, jjr. S$       S^S- jjr/ S$       S_S. jjr0    S`S/ jr1SS\'RP                  \)RT                  4           SaS0 jjr2 S$       SbS1 jjr3SS\'RP                  \)RT                  4           ScS2 jjr4 S$       SdS3 jjr5SS\'RP                  \)RT                  4           SeS4 jjr6 S$       SfS5 jjr7SS\'RP                  \)RT                  4           SgS6 jjr8 S$       ShS7 jjr9SS\'RP                  \)RT                  4           SiS8 jjr: S$       SjS9 jjr;SS\'RP                  \)RT                  4           SkS: jjr< S$       SlS; jjr=SS\'RP                  \)RT                  4           SmS< jjr>    Sn             SoS= jjr?            SpS> jr@            SqS? jrA                    SrS@ jrB\CR                  \CR                  \CR                  \CR                  SA.rH                SsSB jrI                SsSC jrJ                SsSD jrK          StSE jrL    Su           SvSF jjrMSGrNg)w	Inspector   a  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, which may be passed an
:class:`_engine.Engine`
or a :class:`_engine.Connection`::

    from sqlalchemy import inspect, create_engine

    engine = create_engine("...")
    insp = inspect(engine)

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

Union[Engine, Connection]bindr   enginebool_op_context_requires_connectr'   dialectzDict[Any, Any]r2   z1.4a  The __init__() method on :class:`_reflection.Inspector` is deprecated and will be removed in a future release.  Please use the :func:`.sqlalchemy.inspect` function on an :class:`_engine.Engine` or :class:`_engine.Connection` in order to acquire an :class:`_reflection.Inspector`.c                &    U R                  U5        g)aR  Initialize a new :class:`_reflection.Inspector`.

:param bind: a :class:`~sqlalchemy.engine.Connection`,
  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`

N)_init_legacyrG   ro   s     r;   __init__Inspector.__init__   s    . 	$rN   c                    [        UR                  S5      (       a  UR                  R                  n U R                  U 5      nU" X25        U$ )N	inspector)hasattrrs   rz   __new__)clsinitro   rG   s       r;   
_constructInspector._construct   s?     4<<--,,((C{{3TrN   c                l    [        US5      (       a  U R                  U5        g U R                  U5        g )Nexec_driver_sql)r{   _init_connection_init_enginerv   s     r;   ru   Inspector._init_legacy   s,    4*++!!$'d#rN   c                    U=U l         U l        UR                  5       R                  5         SU l        U R                  R
                  U l        0 U l        g )NT)ro   rp   connectcloserr   rs   r2   )rG   rp   s     r;   r   Inspector._init_engine   sC    "((	DK ,0){{**rN   c                    Xl         UR                  U l        SU l        U R                  R                  U l        0 U l        g )NF)ro   rp   rr   rs   r2   )rG   
connections     r;   r   Inspector._init_connection  s4    	 '',1){{**rN   c                8    U R                   R                  5         g)zreset the cache for this :class:`.Inspector`.

Inspection methods that have data cached will emit SQL queries
when next called to get new data.

.. versionadded:: 2.0

N)r2   clearrG   s    r;   clear_cacheInspector.clear_cache  s     	rN   a  The from_engine() method on :class:`_reflection.Inspector` is deprecated and will be removed in a future release.  Please use the :func:`.sqlalchemy.inspect` function on an :class:`_engine.Engine` or :class:`_engine.Connection` in order to acquire an :class:`_reflection.Inspector`.c                :    U R                  U R                  U5      $ )a  Construct a new dialect-specific Inspector object from the given
engine or connection.

:param bind: a :class:`~sqlalchemy.engine.Connection`
 or :class:`~sqlalchemy.engine.Engine`.

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`.

)r   ru   )r}   ro   s     r;   from_engineInspector.from_engine  s    : ~~c..55rN   c                J    [         R                  [         R                  U 5      $ r5   )rl   r   r   ro   s    r;   _engine_inspInspector._engine_insp7  s    ##I$:$:DAArN   c                J    [         R                  [         R                  U 5      $ r5   )rl   r   r   r   s    r;   _connection_inspInspector._connection_insp;  s    ##I$>$>EErN   c              #    #    U R                   (       a  U R                  R                  5       nOU R                  n Uv   U R                   (       a  UR                  5         gg! U R                   (       a  UR                  5         f f = f7f)zReturn a context that optimizes for multiple operations on a single
transaction.

This essentially allows connect()/close() to be called if we detected
that we're against an :class:`_engine.Engine` and not a
:class:`_engine.Connection`.

N)rr   ro   r   r   )rG   conns     r;   _operation_contextInspector._operation_context?  sc      ,,99$$&D99D	J00

 1t00

 1s   9B
A#  #B
#$BB
c              #     #    U R                  5        nU R                  U R                  R                  U5      nU R                  Ul        Uv   SSS5        g! , (       d  f       g= f7f)zmReturn an :class:`_reflection.Inspector`
from this one that will run all
operations on a single connection.

N)r   r   	__class__r   r2   )rG   r   sub_insps      r;   _inspection_contextInspector._inspection_contextT  sK      $$&$t~~'F'FMH"&//HN '&&s   A)<A	A)
A&"A)c                .    U R                   R                  $ )zReturn 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.

)rs   default_schema_namer   s    r;   r   Inspector.default_schema_namea  s     ||///rN   c                    U R                  5        nU R                  R                  " U4SU R                  0UD6sSSS5        $ ! , (       d  f       g= f)zReturn all schema names.

:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.
r2   N)r   rs   get_schema_namesr2   rG   rJ   r   s      r;   r   Inspector.get_schema_namesl  sG     $$&$<<00!%46 '&&   )A
ANc                    U R                  5        nU R                  R                  " X14SU R                  0UD6sSSS5        $ ! , (       d  f       g= f)aT  Return all table names 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` and/or
:meth:`_reflection.Inspector.get_materialized_view_names`
methods.

: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 \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.

.. seealso::

    :meth:`_reflection.Inspector.get_sorted_table_and_fkc_names`

    :attr:`_schema.MetaData.sorted_tables`

r2   N)r   rs   get_table_namesr2   rG   r   rJ   r   s       r;   r   Inspector.get_table_namesy  sG    8 $$&$<<//)-<> '&&r   c                    U R                  5        nU R                  R                  " XAU4SU R                  0UD6sSSS5        $ ! , (       d  f       g= f)a  Return True if the backend has a table, view, or temporary
table of the given name.

:param table_name: name of the table to check
:param schema: schema name to query, if not the default schema.
:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.

.. versionadded:: 1.4 - the :meth:`.Inspector.has_table` method
   replaces the :meth:`_engine.Engine.has_table` method.

.. versionchanged:: 2.0:: :meth:`.Inspector.has_table` now formally
   supports checking for additional table-like objects:

   * any type of views (plain or materialized)
   * temporary tables of any kind

   Previously, these two checks were not formally specified and
   different dialects would vary in their behavior.   The dialect
   testing suite now includes tests for all of these object types
   and should be supported by all SQLAlchemy-included dialects.
   Support among third party dialects may be lagging, however.

r2   N)r   rs   	has_tabler2   rG   
table_namer   rJ   r   s        r;   r   Inspector.has_table  sI    8 $$&$<<))&59__HJ '&&   *A
Ac                    U R                  5        nU R                  R                  " XAU4SU R                  0UD6sSSS5        $ ! , (       d  f       g= f)aj  Return True if the backend has a sequence with the given name.

:param sequence_name: name of the sequence to check
:param schema: schema name to query, if not the default schema.
:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.

.. versionadded:: 1.4

r2   N)r   rs   has_sequencer2   )rG   sequence_namer   rJ   r   s        r;   r   Inspector.has_sequence  sI     $$&$<<,,V8<KM '&&r   c                    U R                  5        nU R                  R                  " UUUU4SU R                  0UD6sSSS5        $ ! , (       d  f       g= f)a  Check the existence of a particular index name in the database.

:param table_name: the name of the table the index belongs to
:param index_name: the name of the index to check
:param schema: schema name to query, if not the default schema.
:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.

.. versionadded:: 2.0

r2   N)r   rs   	has_indexr2   )rG   r   
index_namer   rJ   r   s         r;   r   Inspector.has_index  sT    & $$&$<<))	
  ??  '&&s   ,A
Ac                    U R                  5        nU R                  R                  " X14SU R                  0UD6sSSS5        $ ! , (       d  f       g= f)a$  Return True if the backend has a schema with the given name.

:param schema_name: name of the schema to check
:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.

.. versionadded:: 2.0

r2   N)r   rs   
has_schemar2   )rG   schema_namerJ   r   s       r;   r   Inspector.has_schema  sG     $$&$<<**.2ooAC '&&r   c                    U R                  U4S9 VVVVVs/ s H1  u  nnU(       a  US   OSU VVVs/ s H  u  u  pVovU4PM     snnn4PM3     snnnnn$ s  snnnf s  snnnnnf )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.

:param schema: schema name to query, if not the default schema.
:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.

.. seealso::

    :meth:`_reflection.Inspector.get_table_names`

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

)consider_schemasr   N)%sort_tables_on_foreign_key_dependency)rG   r   rJ   	table_keyfk_collection_tnamefkss           r;   get_sorted_table_and_fkc_names(Inspector.get_sorted_table_and_fkc_names  sy    P ;;"( < 
 !*	!t5BC]/*1c]C
 	
 D
s   AA
AAr5   c                  ^ [         [        [           [        4   n[        5       n[        5       n0 n/ nU H  nU R                  " U40 UD6n	UR                  U	5        U	R                  5        HX  u  u  pnU Vs1 s H  oS   iM	     snXhU4'   U H1  nXS   :w  d
  XS   :w  d  M  UR                  US   US   4X445        M3     MZ     M      [        [        R                  " XG5      5      nU VVVs/ s H8  u  pX4XhU4   R!                  S U 5       5       Vs/ s H  nX4U4PM
     sn4PM:     nnnnUS[        U5      4/-   $ s  snf ! [        R                   an  nUR                   H5  mUR                  T5        UR                  U4S jUTS       5       5        M7     [        [        R                  " XG5      5      n SnANSnAff = fs  snf s  snnnf )a  Return dependency-sorted table and foreign key constraint names
referred to within multiple schemas.

This method may be compared to
:meth:`.Inspector.get_sorted_table_and_fkc_names`, which
works on one schema at a time; here, the method is a generalization
that will consider multiple schemas at once including that it will
resolve for cross-schema foreign keys.

.. versionadded:: 2.0

namereferred_tablereferred_schemac              3  2   >#    U  H  nTS    U4v   M     g7f)r   Nr[   )r9   fkcedges     r;   r<   BInspector.sort_tables_on_foreign_key_dependency.<locals>.<genexpr>`  s      &.HsT!WcN.Hs   r   Nc              3  *   #    U  H	  u  pUv   M     g 7fr5   r[   )r9   r   r   s      r;   r<   r   m  s      M,:Ns   )r   r   r7   setget_multi_foreign_keysextendrE   addlistr%   sortr   CircularDependencyErroredgesremoveupdate
difference)rG   r   rJ   	SchemaTabtuplesremaining_fkcsfknames_for_tabletnamesschnameschema_fkeysr   r   fkeysfkfkeycandidate_sorterrrL   r   s                     @r;   r   /Inspector.sort_tables_on_foreign_key_dependency(  s   , (3-,-	365?BuAC"$'G66wE"ELMM,'%1%7%7%9!
E).7).2vJ7!E"23 "D&6!77"+<&==

 %)):$;$()9$:!" ") 0 "	 &: (*
	D!+"2"26"BCN. %3
 %3    0%0@ALL M,:M  %r* %3 	 
 tT.12333W7& ** 	D		d#%% &.?Q.H&  " "+"2"26"BCN	D
s7   9EE 3(GG*GG A$G		GGc                    U R                  5        nU R                  R                  " U4SU R                  0UD6sSSS5        $ ! , (       d  f       g= f)aP  Return a list of temporary table names for the current bind.

This method is unsupported by most dialects; currently
only Oracle Database, PostgreSQL and SQLite implements it.

:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.

r2   N)r   rs   get_temp_table_namesr2   r   s      r;   r   Inspector.get_temp_table_namesv  sG     $$&$<<44!%46 '&&r   c                    U R                  5        nU R                  R                  " U4SU R                  0UD6sSSS5        $ ! , (       d  f       g= f)a>  Return a list of temporary view names for the current bind.

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

:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.

r2   N)r   rs   get_temp_view_namesr2   r   s      r;   r   Inspector.get_temp_view_names  sG     $$&$<<33!%46 '&&r   c                    U R                  5        nU R                  R                  " XAU4SU R                  0UD6sSSS5        $ ! , (       d  f       g= f)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 and Oracle
Database 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`.

:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.

:return: a dict with the table options. The returned keys depend on the
 dialect in use. Each one is prefixed with the dialect name.

.. seealso:: :meth:`Inspector.get_multi_table_options`

r2   N)r   rs   get_table_optionsr2   r   s        r;   r   Inspector.get_table_options  sI    4 $$&$<<11&59__HJ '&&r   c           
         U R                  5        nU R                  R                  " U4UUUUU R                  S.UD6n[	        U5      sSSS5        $ ! , (       d  f       g= f)a  Return a dictionary of options specified when the tables in the
given schema were created.

The tables can be filtered by passing the names to use to
``filter_names``.

This currently includes some options that apply to MySQL and Oracle
tables.

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

:param filter_names: optionally return information only for the
 objects listed here.

:param kind: a :class:`.ObjectKind` that specifies the type of objects
 to reflect. Defaults to ``ObjectKind.TABLE``.

:param scope: a :class:`.ObjectScope` that specifies if options of
 default, temporary or any tables should be reflected.
 Defaults to ``ObjectScope.DEFAULT``.

:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.

:return: a dictionary where the keys are two-tuple schema,table-name
 and the values are dictionaries with the table options.
 The returned keys in each dict depend on the
 dialect in use. Each one is prefixed with the dialect name.
 The schema is ``None`` if no schema is provided.

.. versionadded:: 2.0

.. seealso:: :meth:`Inspector.get_table_options`
r   filter_nameskindscoper2   N)r   rs   get_multi_table_optionsr2   dict)rG   r   r   r   r   rJ   r   ress           r;   r   !Inspector.get_multi_table_options  sa    Z $$&$,,66)?? C 9 '&&s   8A
A!c                    U R                  5        nU R                  R                  " X14SU R                  0UD6sSSS5        $ ! , (       d  f       g= f)a  Return all non-materialized view names in `schema`.

:param schema: Optional, retrieve names from a non-default schema.
 For special quoting, use :class:`.quoted_name`.
:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.


.. versionchanged:: 2.0  For those dialects that previously included
   the names of materialized views in this list (currently PostgreSQL),
   this method no longer returns the names of materialized views.
   the :meth:`.Inspector.get_materialized_view_names` method should
   be used instead.

.. seealso::

    :meth:`.Inspector.get_materialized_view_names`

r2   N)r   rs   get_view_namesr2   r   s       r;   r  Inspector.get_view_names  sG    0 $$&$<<..)-<> '&&r   c                    U R                  5        nU R                  R                  " X14SU R                  0UD6sSSS5        $ ! , (       d  f       g= f)a  Return all materialized view names in `schema`.

:param schema: Optional, retrieve names from a non-default schema.
 For special quoting, use :class:`.quoted_name`.
:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.

.. versionadded:: 2.0

.. seealso::

    :meth:`.Inspector.get_view_names`

r2   N)r   rs   get_materialized_view_namesr2   r   s       r;   r  %Inspector.get_materialized_view_names  sG    & $$&$<<;;)-<> '&&r   c                    U R                  5        nU R                  R                  " X14SU R                  0UD6sSSS5        $ ! , (       d  f       g= f)a;  Return all sequence names in `schema`.

:param schema: Optional, retrieve names from a non-default schema.
 For special quoting, use :class:`.quoted_name`.
:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.

r2   N)r   rs   get_sequence_namesr2   r   s       r;   r  Inspector.get_sequence_names$  sG     $$&$<<22)-<> '&&r   c                    U R                  5        nU R                  R                  " XAU4SU R                  0UD6sSSS5        $ ! , (       d  f       g= f)a  Return definition for the plain or materialized view called
``view_name``.

:param view_name: Name of the view.
:param schema: Optional, retrieve names from a non-default schema.
 For special quoting, use :class:`.quoted_name`.
:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.

r2   N)r   rs   get_view_definitionr2   )rG   	view_namer   rJ   r   s        r;   r
  Inspector.get_view_definition6  sI     $$&$<<3348OOGI '&&r   c                    U R                  5        nU R                  R                  " XAU4SU R                  0UD6nSSS5        W(       a  U R	                  U/5        U$ ! , (       d  f       N)= f)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 :class:`.ReflectedColumn`.

: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`.

:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.

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

.. seealso:: :meth:`Inspector.get_multi_columns`.

r2   N)r   rs   get_columnsr2   _instantiate_types)rG   r   r   rJ   r   col_defss         r;   r  Inspector.get_columnsJ  sg    4 $$&$||//&59__HJH ' ##XJ/ '&s   +A
A-c                t    U H2  nU H)  nUS   n[        U[        5      (       a  M  U" 5       US'   M+     M4     g )Ntype)r6   r#   )rG   datar  col_defcoltypes        r;   r  Inspector._instantiate_typesl  s9     H#!&/!':66&-iGFO $ rN   c                   U R                  5        n[        U R                  R                  " U4UUUUU R                  S.UD65      nSSS5        U R                  WR                  5       5        U$ ! , (       d  f       N/= f)a  Return information about columns in all objects in the given
schema.

The objects can be filtered by passing the names to use to
``filter_names``.

For each table the value is a list of :class:`.ReflectedColumn`.

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

:param filter_names: optionally return information only for the
 objects listed here.

:param kind: a :class:`.ObjectKind` that specifies the type of objects
 to reflect. Defaults to ``ObjectKind.TABLE``.

:param scope: a :class:`.ObjectScope` that specifies if columns of
 default, temporary or any tables should be reflected.
 Defaults to ``ObjectScope.DEFAULT``.

:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.

:return: a dictionary where the keys are two-tuple schema,table-name
 and the values are list of dictionaries, each representing the
 definition of a database column.
 The schema is ``None`` if no schema is provided.

.. versionadded:: 2.0

.. seealso:: :meth:`Inspector.get_columns`
r   N)r   r   rs   get_multi_columnsr2   r  values)rG   r   r   r   r   rJ   r   table_col_defss           r;   r  Inspector.get_multi_columnsv  s    X $$&$!..!!-# 
N ' 	 5 5 78 '&s   7A11
A?c                    U R                  5        nU R                  R                  " XAU4SU R                  0UD6sSSS5        $ ! , (       d  f       g= f)a  Return information about primary key constraint in ``table_name``.

Given a string ``table_name``, and an optional string `schema`, return
primary key information as a :class:`.ReflectedPrimaryKeyConstraint`.

: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`.

:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.

:return: a dictionary representing the definition of
 a primary key constraint.

.. seealso:: :meth:`Inspector.get_multi_pk_constraint`
r2   N)r   rs   get_pk_constraintr2   r   s        r;   r  Inspector.get_pk_constraint  sI    0 $$&$<<11&59__HJ '&&r   c                    U R                  5        n[        U R                  R                  " U4UUUUU R                  S.UD65      sSSS5        $ ! , (       d  f       g= f)a  Return information about primary key constraints in
all tables in the given schema.

The tables can be filtered by passing the names to use to
``filter_names``.

For each table the value is a :class:`.ReflectedPrimaryKeyConstraint`.

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

:param filter_names: optionally return information only for the
 objects listed here.

:param kind: a :class:`.ObjectKind` that specifies the type of objects
 to reflect. Defaults to ``ObjectKind.TABLE``.

:param scope: a :class:`.ObjectScope` that specifies if primary keys of
 default, temporary or any tables should be reflected.
 Defaults to ``ObjectScope.DEFAULT``.

:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.

:return: a dictionary where the keys are two-tuple schema,table-name
 and the values are dictionaries, each representing the
 definition of a primary key constraint.
 The schema is ``None`` if no schema is provided.

.. versionadded:: 2.0

.. seealso:: :meth:`Inspector.get_pk_constraint`
r   N)r   r   rs   get_multi_pk_constraintr2   rG   r   r   r   r   rJ   r   s          r;   r!  !Inspector.get_multi_pk_constraint  s^    V $$&$44!!-# 
 '&&   6A
Ac                    U R                  5        nU R                  R                  " XAU4SU R                  0UD6sSSS5        $ ! , (       d  f       g= f)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
:class:`.ReflectedForeignKeyConstraint`.

: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`.

:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.

:return: a list of dictionaries, each representing the
 a foreign key definition.

.. seealso:: :meth:`Inspector.get_multi_foreign_keys`
r2   N)r   rs   get_foreign_keysr2   r   s        r;   r&  Inspector.get_foreign_keys  sI    4 $$&$<<00&59__HJ '&&r   c                    U R                  5        n[        U R                  R                  " U4UUUUU R                  S.UD65      sSSS5        $ ! , (       d  f       g= f)a  Return information about foreign_keys in all tables
in the given schema.

The tables can be filtered by passing the names to use to
``filter_names``.

For each table the value is a list of
:class:`.ReflectedForeignKeyConstraint`.

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

:param filter_names: optionally return information only for the
 objects listed here.

:param kind: a :class:`.ObjectKind` that specifies the type of objects
 to reflect. Defaults to ``ObjectKind.TABLE``.

:param scope: a :class:`.ObjectScope` that specifies if foreign keys of
 default, temporary or any tables should be reflected.
 Defaults to ``ObjectScope.DEFAULT``.

:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.

:return: a dictionary where the keys are two-tuple schema,table-name
 and the values are list of dictionaries, each representing
 a foreign key definition.
 The schema is ``None`` if no schema is provided.

.. versionadded:: 2.0

.. seealso:: :meth:`Inspector.get_foreign_keys`
r   N)r   r   rs   r   r2   r"  s          r;   r    Inspector.get_multi_foreign_keys%  s^    Z $$&$33!!-# 
 '&&r$  c                    U R                  5        nU R                  R                  " XAU4SU R                  0UD6sSSS5        $ ! , (       d  f       g= f)a  Return information about indexes in ``table_name``.

Given a string ``table_name`` and an optional string `schema`, return
index information as a list of :class:`.ReflectedIndex`.

: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`.

:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.

:return: a list of dictionaries, each representing the
 definition of an index.

.. seealso:: :meth:`Inspector.get_multi_indexes`
r2   N)r   rs   get_indexesr2   r   s        r;   r+  Inspector.get_indexes_  sI    2 $$&$<<++&59__HJ '&&r   c                    U R                  5        n[        U R                  R                  " U4UUUUU R                  S.UD65      sSSS5        $ ! , (       d  f       g= f)a  Return information about indexes in in all objects
in the given schema.

The objects can be filtered by passing the names to use to
``filter_names``.

For each table the value is a list of :class:`.ReflectedIndex`.

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

:param filter_names: optionally return information only for the
 objects listed here.

:param kind: a :class:`.ObjectKind` that specifies the type of objects
 to reflect. Defaults to ``ObjectKind.TABLE``.

:param scope: a :class:`.ObjectScope` that specifies if indexes of
 default, temporary or any tables should be reflected.
 Defaults to ``ObjectScope.DEFAULT``.

:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.

:return: a dictionary where the keys are two-tuple schema,table-name
 and the values are list of dictionaries, each representing the
 definition of an index.
 The schema is ``None`` if no schema is provided.

.. versionadded:: 2.0

.. seealso:: :meth:`Inspector.get_indexes`
r   N)r   r   rs   get_multi_indexesr2   r"  s          r;   r.  Inspector.get_multi_indexes}  s^    X $$&$..!!-# 
 '&&r$  c                    U R                  5        nU R                  R                  " XAU4SU R                  0UD6sSSS5        $ ! , (       d  f       g= f)a  Return 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
:class:`.ReflectedUniqueConstraint`.

: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`.

:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.

:return: a list of dictionaries, each representing the
 definition of an unique constraint.

.. seealso:: :meth:`Inspector.get_multi_unique_constraints`
r2   N)r   rs   get_unique_constraintsr2   r   s        r;   r1   Inspector.get_unique_constraints  sI    4 $$&$<<66&59__HJ '&&r   c                    U R                  5        n[        U R                  R                  " U4UUUUU R                  S.UD65      sSSS5        $ ! , (       d  f       g= f)a  Return information about unique constraints in all tables
in the given schema.

The tables can be filtered by passing the names to use to
``filter_names``.

For each table the value is a list of
:class:`.ReflectedUniqueConstraint`.

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

:param filter_names: optionally return information only for the
 objects listed here.

:param kind: a :class:`.ObjectKind` that specifies the type of objects
 to reflect. Defaults to ``ObjectKind.TABLE``.

:param scope: a :class:`.ObjectScope` that specifies if constraints of
 default, temporary or any tables should be reflected.
 Defaults to ``ObjectScope.DEFAULT``.

:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.

:return: a dictionary where the keys are two-tuple schema,table-name
 and the values are list of dictionaries, each representing the
 definition of an unique constraint.
 The schema is ``None`` if no schema is provided.

.. versionadded:: 2.0

.. seealso:: :meth:`Inspector.get_unique_constraints`
r   N)r   r   rs   get_multi_unique_constraintsr2   r"  s          r;   r4  &Inspector.get_multi_unique_constraints  s^    Z $$&$99!!-# 
 '&&r$  c                    U R                  5        nU R                  R                  " XAU4SU R                  0UD6sSSS5        $ ! , (       d  f       g= f)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 :class:`.ReflectedTableComment`.

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

: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`.

:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.

:return: a dictionary, with the table comment.

.. versionadded:: 1.2

.. seealso:: :meth:`Inspector.get_multi_table_comment`
r2   N)r   rs   get_table_commentr2   r   s        r;   r7  Inspector.get_table_comment  sI    : $$&$<<11&59__HJ '&&r   c                    U R                  5        n[        U R                  R                  " U4UUUUU R                  S.UD65      sSSS5        $ ! , (       d  f       g= f)a  Return information about the table comment in all objects
in the given schema.

The objects can be filtered by passing the names to use to
``filter_names``.

For each table the value is a :class:`.ReflectedTableComment`.

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

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

:param filter_names: optionally return information only for the
 objects listed here.

:param kind: a :class:`.ObjectKind` that specifies the type of objects
 to reflect. Defaults to ``ObjectKind.TABLE``.

:param scope: a :class:`.ObjectScope` that specifies if comments of
 default, temporary or any tables should be reflected.
 Defaults to ``ObjectScope.DEFAULT``.

:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.

:return: a dictionary where the keys are two-tuple schema,table-name
 and the values are dictionaries, representing the
 table comments.
 The schema is ``None`` if no schema is provided.

.. versionadded:: 2.0

.. seealso:: :meth:`Inspector.get_table_comment`
r   N)r   r   rs   get_multi_table_commentr2   r"  s          r;   r:  !Inspector.get_multi_table_comment1  s^    ^ $$&$44!!-# 
 '&&r$  c                    U R                  5        nU R                  R                  " XAU4SU R                  0UD6sSSS5        $ ! , (       d  f       g= f)a  Return 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
:class:`.ReflectedCheckConstraint`.

: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`.

:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.

:return: a list of dictionaries, each representing the
 definition of a check constraints.

.. seealso:: :meth:`Inspector.get_multi_check_constraints`
r2   N)r   rs   get_check_constraintsr2   r   s        r;   r=  Inspector.get_check_constraintsm  sI    4 $$&$<<55&59__HJ '&&r   c                    U R                  5        n[        U R                  R                  " U4UUUUU R                  S.UD65      sSSS5        $ ! , (       d  f       g= f)a  Return information about check constraints in all tables
in the given schema.

The tables can be filtered by passing the names to use to
``filter_names``.

For each table the value is a list of
:class:`.ReflectedCheckConstraint`.

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

:param filter_names: optionally return information only for the
 objects listed here.

:param kind: a :class:`.ObjectKind` that specifies the type of objects
 to reflect. Defaults to ``ObjectKind.TABLE``.

:param scope: a :class:`.ObjectScope` that specifies if constraints of
 default, temporary or any tables should be reflected.
 Defaults to ``ObjectScope.DEFAULT``.

:param \**kw: Additional keyword argument to pass to the dialect
 specific implementation. See the documentation of the dialect
 in use for more information.

:return: a dictionary where the keys are two-tuple schema,table-name
 and the values are list of dictionaries, each representing the
 definition of a check constraints.
 The schema is ``None`` if no schema is provided.

.. versionadded:: 2.0

.. seealso:: :meth:`Inspector.get_check_constraints`
r   N)r   r   rs   get_multi_check_constraintsr2   r"  s          r;   r@  %Inspector.get_multi_check_constraints  s^    Z $$&$88!!-# 
 '&&r$  c                   Ub  X;   a  gUR                  U5        U R                  R                  nU R                  5        nUR	                  U5      n	SSS5        UR
                  n
UR                   Vs0 s H/  nXR                  ;   d  M  XR                  R                  U5      _M1     nnW	U
4nUb  XR                  ;  a?  U R                  " U	4U
/[        R                  [        R                  US.UR                  D6nXR                  ;   a  UR                  U   eXR                  ;  a  [        R                   " U
5      eUR"                  (       a3  UR"                  R                  U5      nU(       a  UR%                  U5        Sn0 nUR                  U    H  nSnU R'                  UUUUU5        M     U(       d,  U R)                  X5      (       d  [        R                   " U
5      eU R+                  XmUUU5        U R-                  UUUUUUUUU5	        U R/                  UUUUUUU5        U R1                  UUUUUUU5        U R3                  UUUUUUU5        U R5                  UUUU5        g! , (       d  f       GN(= fs  snf )a  Given 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 import inspect

    engine = create_engine("...")
    meta = MetaData()
    user_table = Table("user", meta)
    insp = inspect(engine)
    insp.reflect_table(user_table, None)

.. versionchanged:: 1.4 Renamed from ``reflecttable`` to
   ``reflect_table``

: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.

N)r   r   r   _reflect_infoFT)r   ro   rs   r   schema_for_objectr   reflection_optionsdialect_kwargsrB   columns_get_reflection_inforY   rd   rg   r3   r   NoSuchTableErrortable_options_validate_dialect_kwargs_reflect_columnr   _reflect_pk_reflect_fk_reflect_indexes_reflect_unique_constraints_reflect_check_constraints_reflect_table_comment)rG   tableinclude_columnsexclude_columnsresolve_fks
_extend_onrC  rs   r   r   r   r?   rE  r   tbl_optsfound_tablecols_by_orig_namecol_ds                     r;   reflect_tableInspector.reflect_table  s   B !"u%))##$$&$++E2F ' ZZ
 //
/((( +A##''**/ 	 
 Z(	 I5J5J$J 55(\^^!oo+ &&M 333--i88111&&z22 &&$2266yAH ..x8>@"**95EK  ! 6 4>>*#E#E&&z22e->	
 	
	
 		
 	((	
 	''	
 	##		
O '&
s   I45JJ4
Jc                   US   nUR                   R                  R                  XU5        UR                  R                  XU5        US   nU(       a  Xs;  d  U(       a  Xt;   a  g US   nS V	s0 s H  n	X;   d  M
  XU	   _M     n
n	SU;   a  U
R                  US   5        / nUR	                  S5      b  US   nUc   e[        U[        5      (       a  [        R                  " USS9nOK[        U[        R                  5      (       d*  [        R                  " [        R                  " U5      SS9nOUnUR                  U5        SU;   a*  [        R                  " S0 US   D6nUR                  U5        S	U;   a*  [        R                  " S0 US	   D6nUR                  U5        [        R                  " Xx/UQ70 U
D6=XV'   nUR                   UR"                  ;   a  SUl        UR%                  USS
9  g s  sn	f )Nr   r  )nullableautoincrementr8   inforK   commentdialect_optionsdefaultT)
_reflectedcomputedidentity)replace_existingr[   )metadatadispatchcolumn_reflectr   rB   r6   r"   	sa_schemaDefaultClauseFetchedValuer   textappendComputedIdentityColumnrK   primary_keyappend_column)rG   rS  r[  rT  rU  rZ  	orig_namer   r  r?   col_kwcolargsdefault_textrd  rf  rg  cols                    r;   rL  Inspector._reflect_column]  s    &M	..tEB%%d59 V} ; 7-
 z AQxK 	 
 %MM% 12399Y+ +L+++,
33#11 T  i.D.DEE#11HH\*t 'NN7# ))>E*,=>HNN8$ ))>E*,=>HNN8$-6-=-=.
#.
'-.
 	
$s 77e'''"COC$7_
s   /	G6<	G6c                   UR                   R                  U5      nU(       a  US    Vs/ s H  nXt;   d  M
  Xu;  d  M  XG   PM     nnUR                  S5      UR                  l        UR                  SS 5      UR                  l        UR                  S5      n	U	(       a%  UR                  R
                  R                  U	5        UR                  R                  U5        g g s  snf )Nconstrained_columnsr   rb  rc  )pk_constraintrB   rt  r   rb  rF  r   _reload)
rG   rC  r   rS  rZ  rU  pk_conspkpk_colsrc  s
             r;   rM  Inspector._reflect_pk  s      --11)< ""788B* &/1/H &!%8   &-[[%8E"(/It(DE%%kk*;<O!!0077H %%g.! s   	C#C#C#c
                b   UR                   R                  U/ 5      n
U
 GH  nUS   nUS    Vs/ s H  nX;   a  XM   R                  OUPM     nnU(       a  [        U5      R	                  U5      (       d&  U(       a!  [        U5      R                  U5      (       a  M  US   nUS   nUS   n/ nUbe  U(       a1  [        R                  " UUR                  4UU R                  UUS.U	D6  U H&  nUR                  SR                  UUU/5      5        M(     OqU(       a?  [        R                  " UUR                  4U R                  [        R                  UUS.U	D6  U H%  nUR                  SR                  UU/5      5        M'     S	U;   a  US	   nO0 n UR                  [        R                  " UUU4S
UR                  S5      S.UD65        GM     g s  snf ! [        R                    a>    ["        R$                  " SUR&                   SU SSR                  U5       S35         GM  f = f)Nr   r}  r   r   referred_columns)r   autoload_withrW  rC  .)r  r   rW  rC  optionsTrb  )link_to_namerb  zOn reflected table z0, skipping reflection of foreign key constraint z-; one or more subject columns within name(s) z, z are not present in the table)foreign_keysrB   rK   r   intersectionr   rl  Tableri  ro   rp  joinBLANK_SCHEMAappend_constraintForeignKeyConstraintr   ConstraintColumnNotFoundErrorr   warnr   )rG   rC  r   rS  rZ  rT  rU  rV  rW  rE  r   fkey_dconnamecr}  r   r   r  refspeccolumnr  s                        r;   rN  Inspector._reflect_fk  sd    **..y"=FVnG
   56#6A -.,B!$((I6   #  +,99/JJ#/0;;OLL $%67O#$45N%&89G*OO&  /&*ii#-&3 - /FNN/>6!JK /
 OO& '+ii(55#-&3 - /FNN388^V,D#EF /F" +''22+ &* &

9 5 "	s #~ 44 		)%** 6.i  #yy)<=> ?++ s   G:GAH.-H.)ascdescnulls_first
nulls_lastc                   UR                   R                  U/ 5      nU GH  n	U	S   n
U	S   nU	R                  S5      nU	R                  S0 5      nU	S   nU	R                  SS5      nU	R                  S0 5      nU	R                  S	5      nU(       a!  [        U5      R                  U5      (       d  M  U(       a  M  / n[	        U5       H  u  nnUcH  U(       d'  [
        R                  " S
U SU
< SUS-    S35          M  [        R                  " UU   5      nO_ UU;   a  UU   nOUR                  U   n UR                  US5       H,  nUU R                  ;   d  M  U R                  U   nU" U5      nM.     UR                  U5        M     [        R                  " U
/UQ7UUS.UD6  GM     g ! [         a/    [
        R                  " U SU< SUR                  < 35         GM   f = f)Nr   column_namesexpressionscolumn_sortingr   r  indexrc  duplicates_constraintz	Skipping  z because key r   z5 reflected as None but no 'expressions' were returnedz key z& was not located in columns for table r[   )_tabler   )indexesrB   r   issubset	enumerater   r  r   ro  r  KeyErrorr   _index_sort_exprsrp  rl  Index)rG   rC  r   rS  rZ  rT  rU  rE  r  index_dr   rG  r  r  r   flavorrc  
duplicatesidx_elementsr  r  idx_elementoptionops                           r;   rO  Inspector._reflect_indexes   s     ''++Ir:G6?Dn-G!++m4K$[[)92>NX&F[[1F%kk*;R@O %<=Js7|'<'<_'M'M L%g.q9&		'xq$qyk *::
 "%((;u+=">K
! 11*;A*>K*/''!*K #1"4"4Q";!T%;%;;!%!7!7!?B*,[/K #< ##K05 /8 ! !!	
 &] D $ !		%heA5 1116@ !!s   F0&F004G)(G)c           
     ^   UR                   R                  U/ 5      nU H  n	U	S   n
U	S   nU	R                  S5      nU	R                  S5      nU	R                  S0 5      nU(       a!  [        U5      R                  U5      (       d  Mi  U(       a  Mr  / nU H/  n UU;   a  UU   OUR                  U   nUR                  U5        M1     UR                  [        R                  " UU
US	.UD65        M     g ! [         a-    [        R                  " SU< SUR                  < S35         M  f = f)
Nr   r  rb  duplicates_indexrc  zunique constraint key 'z(' was not located in columns for table '')r   rb  )unique_constraintsrB   r   r  r  rp  r  r   r  r   r  rl  UniqueConstraint)rG   rC  r   rS  rZ  rT  rU  rE  constraintsconst_dr  rG  rb  r  rc  constrained_colsr  constrained_cols                     r;   rP  %Inspector._reflect_unique_constraintsb  s0    $66::9bI"GfoGn-Gkk),G %78J%kk*;R@Os7|'<'<_'M'M  "=  11 *!,"WWQZ $ %++O<  ##**% # &	7 #(   II45uzzCs   C553D,+D,c                    UR                   R                  U/ 5      nU H(  n	UR                  [        R                  " S0 U	D65        M*     g )Nr[   )check_constraintsrB   r  rl  CheckConstraint)
rG   rC  r   rS  rZ  rT  rU  rE  r  r  s
             r;   rQ  $Inspector._reflect_check_constraints  sB     $5599)RH"G##I$=$=$H$HI #rN   c                ^    UR                   R                  U5      nU(       a  US   Ul        g g Nro  )table_commentrB   rb  )rG   rC  r   rS  rE  comment_dicts         r;   rR   Inspector._reflect_table_comment  s.     %2266yA(0EM rN   c                  ^ ^^^	^
 UTS'   T(       a.  U(       a'  [        T5      S:  a  [        T5      [        U5      -  m	OS m	0 =TS'   nSm
SSS.       SUU	U
UU 4S jjjn[        U" T R                  SS9U" T R                  5      U" T R                  5      U" T R
                  5      U" T R                  SS	9U" T R                  SS	9U" T R                  SS	9U" T R                  SS	9US
9	nU(       a  UR                  U5        U$ U$ )Nr   d   r3   TF)optionalcheck_filter_names_from_methc                  > Tb0  TS::  d*  T	R                   R                  U R                  5      (       d  TnOS n T(       a  U " SSU0TD6nU(       a	  U(       d  SmU$ 0 n U$ ! [         a    U(       d  e 0 n U$ f = f)Ng      ?r   Fr[   )rs   _overrides_defaultrC   NotImplementedError)
methr  r  _fnr   r   fraction
has_resultrJ   rG   s
        r;   run+Inspector._get_reflection_info.<locals>.run  s      s?||66t}}EE"6C626C3C &+
 J C
 J	 ' J	s   !A# A# #A;:A;)r  )r  )	rG  r~  r  r  r  r  r  rJ  r3   )r  r   r  rq   r  rq   rU   r   )len_ReflectionInfor  r!  r   r.  r4  r:  r@  r   r   )rG   r   r   	availablerC  rJ   r3   r  ra  r  r  s   ` `  `   @@r;   rH  Inspector._get_reflection_info  s<    8I#l*;c*A<(3y>9HH /10?m

 #16	!	!	 !	 +/	!	
 !	 !	F &&T d::;T889../"11D  d::TJ!004 d::TJ'
"   &  KrN   )rr   ro   rs   rp   r2   )ro   rn   )r~   zCallable[..., Any]ro   rn   rU   rl   )ro   rn   rU   None)rp   r   rU   r  )r   r   rU   r  )rU   r  )ro   r   rU   rl   )ro   r   rU   rl   )rU   z!Generator[Connection, None, None])rU   z Generator[Inspector, None, None])rU   Optional[str])rJ   r   rU   	List[str])r   r  rJ   r   rU   r  )r   r7   r   r  rJ   r   rU   rq   )r   r7   r   r  rJ   r   rU   rq   )
r   r7   r   r7   r   r  rJ   r   rU   rq   )r   r7   rJ   r   rU   rq   )r   r  rJ   r   rU   z;List[Tuple[Optional[str], List[Tuple[str, Optional[str]]]]])r5   )r   zCollection[Optional[str]]rJ   r   rU   zgList[Tuple[Optional[Tuple[Optional[str], str]], List[Tuple[Tuple[Optional[str], str], Optional[str]]]]])r   r7   r   r  rJ   r   rU   Dict[str, Any])r   r  r   Optional[Sequence[str]]r   rY   r   rg   rJ   r   rU   Dict[TableKey, Dict[str, Any]])r  r7   r   r  rJ   r   rU   r7   )r   r7   r   r  rJ   r   rU   List[ReflectedColumn])r  zIterable[List[ReflectedColumn]]rU   r  )r   r  r   r  r   rY   r   rg   rJ   r   rU   %Dict[TableKey, List[ReflectedColumn]])r   r7   r   r  rJ   r   rU   r,   )r   r  r   r  r   rY   r   rg   rJ   r   rU   z-Dict[TableKey, ReflectedPrimaryKeyConstraint])r   r7   r   r  rJ   r   rU   #List[ReflectedForeignKeyConstraint])r   r  r   r  r   rY   r   rg   rJ   r   rU   3Dict[TableKey, List[ReflectedForeignKeyConstraint]])r   r7   r   r  rJ   r   rU   List[ReflectedIndex])r   r  r   r  r   rY   r   rg   rJ   r   rU   $Dict[TableKey, List[ReflectedIndex]])r   r7   r   r  rJ   r   rU   List[ReflectedUniqueConstraint])r   r  r   r  r   rY   r   rg   rJ   r   rU   /Dict[TableKey, List[ReflectedUniqueConstraint]])r   r7   r   r  rJ   r   rU   r-   )r   r  r   r  r   rY   r   rg   rJ   r   rU   z%Dict[TableKey, ReflectedTableComment])r   r7   r   r  rJ   r   rU   List[ReflectedCheckConstraint])r   r  r   r  r   rY   r   rg   rJ   r   rU   .Dict[TableKey, List[ReflectedCheckConstraint]])r[   TNN)rS  sa_schema.TablerT  Optional[Collection[str]]rU  Collection[str]rV  rq   rW  Optional[Set[sa_schema.Table]]rC  Optional[_ReflectionInfo]rU   r  )rS  r  r[  r)   rT  r  rU  r  rZ   Dict[str, sa_schema.Column[Any]]rU   r  )rC  r  r   r/   rS  r  rZ  r  rU  r  rU   r  )rC  r  r   r/   rS  r  rZ  r  rT  r  rU  r  rV  rq   rW  r  rE  r  rU   r  )rC  r  r   r/   rS  r  rZ  r  rT  r  rU  r  rE  r  rU   r  )
rC  r  r   r/   rS  r  rE  r  rU   r  )NNNN)r   r  r   r  r  r  rC  r  rJ   r   rU   r  )OrC   r\   r]   r^   r_   __annotations__r   
deprecatedrw   classmethodr   ru   r   r   r   r   r   	_inspectsr   r   r   r   
contextlibcontextmanagerr   r   propertyr   r   r   r   r   r   r   r   r   r   r   r   rY   r`   rg   ri   r   r  r  r  r
  r  r  r  r  r!  r&  r   r+  r.  r1  r4  r7  r:  r=  r@  r\  rL  rM  rN  r   asc_opdesc_opnulls_first_opnulls_last_opr  rO  rP  rQ  rR  rH  re   r[   rN   r;   rl   rl      sH
   0 $#N"&&	__	5
 
  %-F	 $	  	__	5
6
 6& &!B "B *%F &F  ( 
 
 0 0 '+#25	D 8<'4CF	D ;? *7FI	. !%	  	
  
:$ !%+
+
 +
 
E	+
^ 7>L43L4 L4
	L4\"" 8<'4CF	B !%04%++(0077 .7 	7
 7 7 
(7t '+#25	< '+#25	2 '+#25	& 7;&3BE	* 8<  '4 CF 	 D030	0 !%04%++(0099 .9 	9
 9 9 
/9x 8<'4CF	&> !%04%++(0066 .6 	6
 6 6 
76r 8<'4CF	,B !%04%++(0088 .8 	8
 8 8 
=8v 8<'4CF	@ !%04%++(0077 .7 	7
 7 7 
.7t 8<'4CF	(B !%04%++(0088 .8 	8
 8 8 
98v 8<  '4 CF 	 H !%04%++(00:: .: 	:
 : : 
/:z 8<'4CF	'B !%04%++(0088 .8 	8
 8 8 
88| ,. 5937U
U
 3U
 )	U

 U
 3U
 1U
 
U
nF8F8 F8 3	F8
 )F8 <F8 
F8P/&/ / 	/
 </ )/ 
/6W&W W 	W
 <W 3W )W W 3W +W 
Wt !! //--	@&@ @ 	@
 <@ 3@ )@ +@ 
@D.&. . 	.
 <. 3. ). +. 
.`J&J J 	J
 <J 3J )J +J 
J	1&	1 	1 		1
 +	1 
	1 !%26/337LL 0L -	L
 1L L 
L LrN   rl   c                      \ rS rSrSr\SS j5       r\SS j5       r\SS j5       r\SS j5       r	\SS j5       r
\SS j5       r\SS	 j5       r\SS
 j5       rSrg)ReflectionDefaultsi  z5provides blank default values for reflection methods.c                    / $ r5   r[   r}   s    r;   rG  ReflectionDefaults.columns      	rN   c                    S / S.$ )N)r   r}  r[   r  s    r;   r~   ReflectionDefaults.pk_constraint  s     #%
 	
rN   c                    / $ r5   r[   r  s    r;   r  ReflectionDefaults.foreign_keys	  r  rN   c                    / $ r5   r[   r  s    r;   r  ReflectionDefaults.indexes  r  rN   c                    / $ r5   r[   r  s    r;   r  %ReflectionDefaults.unique_constraints  r  rN   c                    / $ r5   r[   r  s    r;   r  $ReflectionDefaults.check_constraints  r  rN   c                    0 $ r5   r[   r  s    r;   rJ   ReflectionDefaults.table_options  r  rN   c                
    SS 0$ r  r[   r  s    r;   r   ReflectionDefaults.table_comment  s    ~rN   r[   N)rU   r  )rU   r,   )rU   r  )rU   r  )rU   r  )rU   r  )rU   r  )rU   r-   )rC   r\   r]   r^   r_   r  rG  r~  r  r  r  r  rJ  r  re   r[   rN   r;   r  r    s    ?  
 
            rN   r  c                  z    \ rS rSr% S\S'   S\S'   S\S'   S\S	'   S
\S'   S\S'   S\S'   S\S'   S\S'   SS jrSrg)r  i"  r  rG  z7Dict[TableKey, Optional[ReflectedPrimaryKeyConstraint]]r~  r  r  r  r  r  r  z/Dict[TableKey, Optional[ReflectedTableComment]]r  r  r  r  rJ  z+Dict[TableKey, exc.UnreflectableTableError]r3   c                    U R                   R                  5        H7  u  p#[        X5      nUc  M  Uc  [        XU5        M&  UR	                  U5        M9     g r5   )__dict__rE   getattrsetattrr   )rG   otherr?   r@   ovs        r;   r   _ReflectionInfo.update/  sD    MM'')DA"B~9DR(HHRL *rN   r[   N)r  r  rU   r  )rC   r\   r]   r^   r  r   re   r[   rN   r;   r  r  "  s=    22JJEE11GGBBEE11>>!rN   r  rT   )rQ   zTuple[str, InternalTraversal]rU   z0Callable[[Callable[..., _R]], Callable[..., _R]])Er_   
__future__r   r  dataclassesr   enumr   r   r   typingr   r	   r
   r   r   r   r   r   r   r   r   r   r   r   baser   r    r   r   r   r   r   r   rl  sql.cache_keyr    sql.elementsr!   r"   sql.type_apir#   sql.visitorsr$   r%   util.typingr&   
interfacesr'   r(   r)   r*   r+   r,   r-   r.   r/   r0   rV   rM   rW   rY   rg   _self_inspectsInspectablerl   r  r  r[   rN   r;   <module>r"     s  & #  !                          % 7 & % % ,  #4+9*915$T] 
 
 	
   >150 " " "> 
*$ 
* 
* A
&&{3 A AH: $ $ $N ! ! !rN   