This commit is contained in:
Chris Tsang 2022-07-23 14:55:38 +08:00
parent 7dc5597745
commit 12d3e602f2

View File

@ -167,6 +167,10 @@ impl RelationDef {
/// ///
/// # Examples /// # Examples
/// ///
/// ```
/// use sea_orm::{entity::*, query::*, DbBackend, tests_cfg::{cake, cake_filling}};
/// use sea_query::{Expr, IntoCondition};
///
/// assert_eq!( /// assert_eq!(
/// cake::Entity::find() /// cake::Entity::find()
/// .join( /// .join(
@ -176,7 +180,7 @@ impl RelationDef {
/// .rev() /// .rev()
/// .on_condition(|_left, right| { /// .on_condition(|_left, right| {
/// Expr::tbl(right, cake_filling::Column::CakeId) /// Expr::tbl(right, cake_filling::Column::CakeId)
/// .gt(10) /// .gt(10i32)
/// .into_condition() /// .into_condition()
/// }) /// })
/// ) /// )
@ -188,6 +192,7 @@ impl RelationDef {
/// ] /// ]
/// .join(" ") /// .join(" ")
/// ); /// );
/// ```
pub fn on_condition<F>(mut self, f: F) -> Self pub fn on_condition<F>(mut self, f: F) -> Self
where where
F: Fn(DynIden, DynIden) -> Condition + 'static + Send + Sync, F: Fn(DynIden, DynIden) -> Condition + 'static + Send + Sync,