Skip to main content

Module relation

Module relation 

Source
Available on crate features model-mysql or model-postgres or model-sqlite only.
Expand description

Async relationship helpers: HasMany, HasOne, BelongsTo.

These are explicit-load helpers โ€” no hidden N+1 queries, no lazy loading. Call .load(&pool) when you want the related records.

Structsยง

BelongsTo
Represents the inverse side of a relationship (child โ†’ owner).
HasMany
Represents a one-to-many relationship from an owner to a collection of T.
HasOne
Represents a one-to-one relationship (owner โ†’ child).