pub trait Joinable<'a> {
// Required method
fn on<T>(self, conditions: T) -> JoinData<'a>
where T: Into<ConditionTree<'a>>;
}
Expand description
An item that can be joined.
Required Methods§
sourcefn on<T>(self, conditions: T) -> JoinData<'a>where
T: Into<ConditionTree<'a>>,
fn on<T>(self, conditions: T) -> JoinData<'a>where T: Into<ConditionTree<'a>>,
Add the JOIN
conditions.
let join_data = "b".on(("b", "id").equals(Column::from(("a", "id"))));
let query = Select::from_table("a").inner_join(join_data);
let (sql, _) = Sqlite::build(query)?;
assert_eq!(
"SELECT `a`.* FROM `a` INNER JOIN `b` ON `b`.`id` = `a`.`id`",
sql,
);
Object Safety§
This trait is not object safe.