Available on crate features
model-mysql or model-postgres or model-sqlite only.Expand description
Async relationship helpers: HasMany, HasOne, BelongsTo, and
BelongsToMany (18.30.0) through a join table.
These are explicit-load helpers — no hidden N+1 queries, no lazy loading.
Call .load(&pool) when you want the related records. Soft-deleted
related rows (#[soft_delete]) are left out. To load a relation for a
whole result set, see Relation and
QueryBuilder::with.
Structs§
- Belongs
To - Represents the inverse side of a relationship (child → owner).
- Belongs
ToMany - Many-to-many through a join table (18.30.0): the rows of
Rone owner is linked to, and the links themselves —attach,detach,sync. - HasMany
- Represents a one-to-many relationship from an owner to a collection of
T. - HasOne
- Represents a one-to-one relationship (owner → child).
- Sync
Changes - What
BelongsToMany::syncchanged: the related keys it linked and unlinked.