Runtime Inspection API¶
Available Inspection Targets¶
Below is a listing of many of the most common inspection targets.
Connectable
(i.e.Engine
,Connection
) - returns anInspector
object.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, anInstanceState
is returned representing the mapped state of the object. TheInstanceState
also provides access to per attribute state via theAttributeState
interface as well as the per-flush “history” of any attribute via theHistory
object.See also
type
(i.e. a class) - a class given will be checked by the ORM for a mapping - if so, aMapper
for that class is returned.See also
mapped attribute - passing a mapped attribute to
inspect()
, such asinspect(MyClass.some_attribute)
, returns aQueryableAttribute
object, which is the descriptor associated with a mapped class. This descriptor refers to aMapperProperty
, which is usually an instance ofColumnProperty
orRelationshipProperty
, via itsQueryableAttribute.property
attribute.AliasedClass
- returns anAliasedInsp
object.