Runtime Inspection API

Available Inspection Targets

Below is a listing of many of the most common inspection targets.

  • Connectable (i.e. Engine, Connection) - returns an Inspector object.

  • ClauseElement - all SQL expression components, including Table, Column, serve as their own inspection objects, meaning any of these objects passed to inspect() return themselves.

  • object - an object given will be checked by the ORM for a mapping - if so, an InstanceState is returned representing the mapped state of the object. The InstanceState also provides access to per attribute state via the AttributeState interface as well as the per-flush “history” of any attribute via the History object.

  • type (i.e. a class) - a class given will be checked by the ORM for a mapping - if so, a Mapper for that class is returned.

  • mapped attribute - passing a mapped attribute to inspect(), such as inspect(MyClass.some_attribute), returns a QueryableAttribute object, which is the descriptor associated with a mapped class. This descriptor refers to a MapperProperty, which is usually an instance of ColumnProperty or RelationshipProperty, via its QueryableAttribute.property attribute.

  • AliasedClass - returns an AliasedInsp object.

Back to Top