1.. _core_inspection_toplevel:
2.. _inspection_toplevel:
3
4Runtime Inspection API
5======================
6
7.. automodule:: sqlalchemy.inspection
8    :members:
9
10Available Inspection Targets
11----------------------------
12
13Below is a listing of many of the most common inspection targets.
14
15* :class:`.Connectable` (i.e. :class:`.Engine`,
16  :class:`.Connection`) - returns an :class:`.Inspector` object.
17* :class:`.ClauseElement` - all SQL expression components, including
18  :class:`.Table`, :class:`.Column`, serve as their own inspection objects,
19  meaning any of these objects passed to :func:`.inspect` return themselves.
20* ``object`` - an object given will be checked by the ORM for a mapping -
21  if so, an :class:`.InstanceState` is returned representing the mapped
22  state of the object.  The :class:`.InstanceState` also provides access
23  to per attribute state via the :class:`.AttributeState` interface as well
24  as the per-flush "history" of any attribute via the :class:`.History`
25  object.
26* ``type`` (i.e. a class) - a class given will be checked by the ORM for a
27  mapping - if so, a :class:`.Mapper` for that class is returned.
28* mapped attribute - passing a mapped attribute to :func:`.inspect`, such
29  as ``inspect(MyClass.some_attribute)``, returns a :class:`.QueryableAttribute`
30  object, which is the :term:`descriptor` associated with a mapped class.
31  This descriptor refers to a :class:`.MapperProperty`, which is usually
32  an instance of :class:`.ColumnProperty`
33  or :class:`.RelationshipProperty`, via its :attr:`.QueryableAttribute.property`
34  attribute.
35* :class:`.AliasedClass` - returns an :class:`.AliasedInsp` object.
36
37