Trait Joinable

Source
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§

Source

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,
);

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a> Joinable<'a> for JoinData<'a>

Source§

impl<'a, U> Joinable<'a> for U
where U: Into<Table<'a>>,