Expand description
Relation loading support for eager and lazy loading.
This module provides types and operations for loading related data:
Includefor eager loading relationsSelectfor specifying which fields to return- Nested relation specifications
§Example
ⓘ
// Eager load posts with their author
let posts = client
.post()
.find_many()
.include(post::author::fetch())
.include(post::comments::fetch().take(5))
.exec()
.await?;
// Select specific fields
let users = client
.user()
.find_many()
.select(user::select! {
id,
email,
posts: { id, title }
})
.exec()
.await?;Structs§
- Include
- Builder for include specifications.
- Include
Spec - Specification for including a relation in a query.
- Relation
Loader - Relation loader for executing relation queries.
- Relation
Spec - Specification for a relation between models.
- Select
Spec - Specification for which fields to select from a model.
Enums§
- Field
Selection - Field selection mode.
- Relation
Load Strategy - Strategy for loading relations.
- Relation
Type - Type of relation between models.