Querying Data, Loading Objects¶
The following sections refer to techniques for emitting SELECT statements within an ORM context. This involves primarily statements that return instances of ORM mapped objects, but also involves calling forms that deliver individual column or groups of columns as well.
For an introduction to querying with the SQLAlchemy ORM, one of the following tutorials should be consulted:
SQLAlchemy 1.4 / 2.0 Tutorial - for 2.0 style usage
Object Relational Tutorial (1.x API) - for 1.x style usage.
As SQLAlchemy 1.4 represents a transition from 1.x to 2.0 style, the below sections are currently mixed as far as which style they are using.
- ORM Querying Guide
- Loading Columns
- Relationship Loading Techniques
- Configuring Loader Strategies at Mapping Time
- Relationship Loading with Loader Options
- Lazy Loading
- Joined Eager Loading
- Subquery Eager Loading
- Select IN loading
- What Kind of Loading to Use ?
- Polymorphic Eager Loading
- Wildcard Loading Strategies
- Routing Explicit Joins/Statements into Eagerly Loaded Collections
- Creating Custom Load Rules
- Relationship Loader API
- Loading Inheritance Hierarchies
- Query API