Runtime Inspection API¶
Available Inspection Targets¶
Below is a listing of many of the most common inspection targets.
Connectable(i.e.Engine,Connection) - returns anInspectorobject.ClauseElement- all SQL expression components, includingTable,Column, serve as their own inspection objects, meaning any of these objects passed toinspect()return themselves.object- an object given will be checked by the ORM for a mapping - if so, anInstanceStateis returned representing the mapped state of the object. TheInstanceStatealso provides access to per attribute state via theAttributeStateinterface as well as the per-flush “history” of any attribute via theHistoryobject.See also
type(i.e. a class) - a class given will be checked by the ORM for a mapping - if so, aMapperfor that class is returned.See also
mapped attribute - passing a mapped attribute to
inspect(), such asinspect(MyClass.some_attribute), returns aQueryableAttributeobject, which is the descriptor associated with a mapped class. This descriptor refers to aMapperProperty, which is usually an instance ofColumnPropertyorRelationshipProperty, via itsQueryableAttribute.propertyattribute.AliasedClass- returns anAliasedInspobject.