pub struct RelationshipConstraintBuilder { /* private fields */ }Expand description
Builder for relationship constraints with type safety and validation
Implementations§
Source§impl RelationshipConstraintBuilder
impl RelationshipConstraintBuilder
pub fn new() -> Self
Sourcepub async fn apply_all(&self, query: &mut QueryBuilder) -> ModelResult<()>
pub async fn apply_all(&self, query: &mut QueryBuilder) -> ModelResult<()>
Apply all constraints to the query builder
Sourcepub fn constraints(&self) -> &[Box<dyn RelationshipConstraint>]
pub fn constraints(&self) -> &[Box<dyn RelationshipConstraint>]
Get all constraints
Sourcepub fn has_constraint_type(&self, constraint_type: &ConstraintType) -> bool
pub fn has_constraint_type(&self, constraint_type: &ConstraintType) -> bool
Check if a constraint type has been applied
Sourcepub fn where_gte<V>(self, field: &str, value: V) -> Self
pub fn where_gte<V>(self, field: &str, value: V) -> Self
Add WHERE greater than or equal constraint
Sourcepub fn where_lte<V>(self, field: &str, value: V) -> Self
pub fn where_lte<V>(self, field: &str, value: V) -> Self
Add WHERE less than or equal constraint
Sourcepub fn where_like(self, field: &str, pattern: &str) -> Self
pub fn where_like(self, field: &str, pattern: &str) -> Self
Add WHERE LIKE constraint
Sourcepub fn order_by_desc(self, field: &str) -> Self
pub fn order_by_desc(self, field: &str) -> Self
Add ORDER BY DESC constraint
Sourcepub fn having<V>(self, field: &str, operator: QueryOperator, value: V) -> Self
pub fn having<V>(self, field: &str, operator: QueryOperator, value: V) -> Self
Add HAVING constraint
Sourcepub fn having_raw(self, condition: &str) -> Self
pub fn having_raw(self, condition: &str) -> Self
Add raw HAVING constraint
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RelationshipConstraintBuilder
impl !RefUnwindSafe for RelationshipConstraintBuilder
impl Send for RelationshipConstraintBuilder
impl Sync for RelationshipConstraintBuilder
impl Unpin for RelationshipConstraintBuilder
impl !UnwindSafe for RelationshipConstraintBuilder
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more