rocket_db_pools::diesel::prelude

Trait JoinOnDsl

Source
pub trait JoinOnDsl: Sized {
    // Provided method
    fn on<On>(self, on: On) -> OnClauseWrapper<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) -> OnClauseWrapper<Self, On>

See the trait documentation.

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<T> JoinOnDsl for T
where T: QuerySource,