Macro diesel::joinable [] [src]

macro_rules! joinable {
    ($($child:ident)::* -> $($parent:ident)::* ($source:ident)) => { ... };
}

Allow two tables to be referenced in a join query.

Example

mod schema {
   table! {
        users(id) {
            id -> Integer,
        }
    }
    table! {
        posts(id) {
            id -> Integer,
            user_id -> Integer,
        }
    }

}

joinable!(schema::posts -> schema::users(user_id));

use schema::*;

// Without the joinable! call, this wouldn't compile
let query = users::table.inner_join(posts::table);