pub struct IncludeRelation {
pub where_: Option<Expr>,
pub order_by: Vec<OrderBy>,
pub take: Option<i32>,
pub skip: Option<u32>,
pub cursor: Option<HashMap<String, Value>>,
pub distinct: Vec<String>,
pub include: HashMap<String, IncludeRelation>,
}Expand description
Arguments for eagerly loading a single relation in a query.
include: { posts: { where: { published: true } } }Fields§
§where_: Option<Expr>Optional filter to apply to the included child records.
order_by: Vec<OrderBy>ORDER BY clauses to apply to the included child records.
take: Option<i32>Maximum number of child rows to include.
skip: Option<u32>Number of child rows to skip.
cursor: Option<HashMap<String, Value>>Optional cursor for child pagination.
distinct: Vec<String>Columns to deduplicate child rows on.
include: HashMap<String, IncludeRelation>Nested relations to include under this child relation.
Implementations§
Source§impl IncludeRelation
impl IncludeRelation
Sourcepub fn with_filter(filter: Expr) -> Self
pub fn with_filter(filter: Expr) -> Self
Create an include with a child filter.
Sourcepub fn with_order_by(self, order: OrderBy) -> Self
pub fn with_order_by(self, order: OrderBy) -> Self
Append an ORDER BY clause for the included child records.
Sourcepub fn with_cursor(self, cursor: HashMap<String, Value>) -> Self
pub fn with_cursor(self, cursor: HashMap<String, Value>) -> Self
Set the child cursor.
Sourcepub fn with_distinct(self, distinct: Vec<String>) -> Self
pub fn with_distinct(self, distinct: Vec<String>) -> Self
Set child DISTINCT columns.
Sourcepub fn with_include(
self,
relation: impl Into<String>,
include: IncludeRelation,
) -> Self
pub fn with_include( self, relation: impl Into<String>, include: IncludeRelation, ) -> Self
Add a nested relation include.
Trait Implementations§
Source§impl Clone for IncludeRelation
impl Clone for IncludeRelation
Source§fn clone(&self) -> IncludeRelation
fn clone(&self) -> IncludeRelation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IncludeRelation
impl Debug for IncludeRelation
Source§impl Default for IncludeRelation
impl Default for IncludeRelation
Source§fn default() -> IncludeRelation
fn default() -> IncludeRelation
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for IncludeRelation
impl RefUnwindSafe for IncludeRelation
impl Send for IncludeRelation
impl Sync for IncludeRelation
impl Unpin for IncludeRelation
impl UnsafeUnpin for IncludeRelation
impl UnwindSafe for IncludeRelation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more