[][src]Macro diesel::allow_columns_to_appear_in_same_group_by_clause

macro_rules! allow_columns_to_appear_in_same_group_by_clause {
    ($($left_path:tt)::+, $($right_path:tt)::+ $(,)?) => { ... };
    ($($left_path:tt)::+, $($right_path:tt)::+, $($other: tt)*) => { ... };
    ($last_col:ty,) => { ... };
    () => { ... };
}

Allow two or more columns which are otherwise unrelated to be used together in a group by clause.

This macro must be invoked any time two columns need to appear in the same group by clause. When this macro is invoked with more than 2 columns, every combination of those columns will be allowed to appear together.

Example

This example is not tested
// This would be required to do
// `users::table.inner_join(posts::table).group_by((users::name, users::hair_color, posts::id))`
allow_columns_to_appear_in_same_group_by_clause!(users::name, users::hair_color, posts::id);

When more than two columns are passed, the relevant code is generated for every combination of those columns. This code would be equivalent to the previous example.

This example is not tested
allow_columns_to_appear_in_same_group_by_clause!(users::name, users::hair_color);
allow_columns_to_appear_in_same_group_by_clause!(users::name, posts::id);
allow_columns_to_appear_in_same_group_by_clause!(users::hair_color, posts::id);