Skip to content

Commit b4810bc

Browse files
authored
Merge pull request diesel-rs#1680 from diesel-rs/sg-aggregate
`max` and `min` are aggregate functions
2 parents 30cb5bc + 1d9dbeb commit b4810bc

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

diesel/src/expression/functions/aggregate_ordering.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ sql_function! {
1616
/// # let connection = establish_connection();
1717
/// assert_eq!(Ok(Some(8)), animals.select(max(legs)).first(&connection));
1818
/// # }
19+
#[aggregate]
1920
fn max<ST: SqlOrd + IntoNullable>(expr: ST) -> ST::Nullable;
2021
}
2122

@@ -35,5 +36,6 @@ sql_function! {
3536
/// # let connection = establish_connection();
3637
/// assert_eq!(Ok(Some(4)), animals.select(min(legs)).first(&connection));
3738
/// # }
39+
#[aggregate]
3840
fn min<ST: SqlOrd + IntoNullable>(expr: ST) -> ST::Nullable;
3941
}

0 commit comments

Comments
 (0)