Trait quaint::ast::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,
);

Implementors§

source§

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

source§

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