Trait diesel::prelude::JoinOnDsl

source ·
pub trait JoinOnDsl: Sized {
    // Provided method
    fn on<On>(self, on: On) -> On<Self, On> { ... }
}
Expand description

Specify the ON clause for a join statement. This will override any implicit ON clause that would come from joinable!

§Example

let data = users::table
    .left_join(posts::table.on(
        users::id.eq(posts::user_id).and(
            posts::title.eq("My first post"))
    ))
    .select((users::name, posts::title.nullable()))
    .load(connection);
let expected = vec![
    ("Sean".to_string(), Some("My first post".to_string())),
    ("Tess".to_string(), None),
];
assert_eq!(Ok(expected), data);

Provided Methods§

source

fn on<On>(self, on: On) -> On<Self, On>

See the trait documentation.

Object Safety§

This trait is not object safe.

Implementors§