prax_query/relations/
mod.rs

1#![allow(dead_code)]
2
3//! Relation loading support for eager and lazy loading.
4//!
5//! This module provides types and operations for loading related data:
6//! - `Include` for eager loading relations
7//! - `Select` for specifying which fields to return
8//! - Nested relation specifications
9//!
10//! ## Example
11//!
12//! ```rust,ignore
13//! // Eager load posts with their author
14//! let posts = client
15//!     .post()
16//!     .find_many()
17//!     .include(post::author::fetch())
18//!     .include(post::comments::fetch().take(5))
19//!     .exec()
20//!     .await?;
21//!
22//! // Select specific fields
23//! let users = client
24//!     .user()
25//!     .find_many()
26//!     .select(user::select! {
27//!         id,
28//!         email,
29//!         posts: { id, title }
30//!     })
31//!     .exec()
32//!     .await?;
33//! ```
34
35mod include;
36mod loader;
37mod select;
38mod spec;
39
40pub use include::{Include, IncludeSpec};
41pub use loader::{RelationLoadStrategy, RelationLoader};
42pub use select::{FieldSelection, SelectSpec};
43pub use spec::{RelationSpec, RelationType};