mirror of https://github.com/AMT-Cheif/drift.git
Nullable date aggregates
This commit is contained in:
parent
3331d625b0
commit
84cf9b82c3
|
@ -1,7 +1,8 @@
|
|||
## 1.8.0-dev
|
||||
## 2.0.0-dev
|
||||
|
||||
- Consistently handle transaction errors like a failing `BEGIN` or `COMMIT`
|
||||
across database implementations.
|
||||
- Fix nullability of `min`, `max` and `avg` in the Dart query builder.
|
||||
|
||||
## 1.7.0
|
||||
|
||||
|
|
|
@ -159,21 +159,21 @@ extension BigIntAggregates<DT extends BigInt> on Expression<DT?> {
|
|||
extension DateTimeAggregate on Expression<DateTime?> {
|
||||
/// Return the average of all non-null values in this group.
|
||||
/// {@macro drift_aggregate_filter}
|
||||
Expression<DateTime> avg({Expression<bool?>? filter}) =>
|
||||
Expression<DateTime?> avg({Expression<bool?>? filter}) =>
|
||||
secondsSinceEpoch.avg(filter: filter).roundToInt().dartCast();
|
||||
|
||||
/// Return the maximum of all non-null values in this group.
|
||||
///
|
||||
/// If there are no non-null values in the group, returns null.
|
||||
/// {@macro drift_aggregate_filter}
|
||||
Expression<DateTime> max({Expression<bool?>? filter}) =>
|
||||
Expression<DateTime?> max({Expression<bool?>? filter}) =>
|
||||
_AggregateExpression('MAX', [this], filter: filter);
|
||||
|
||||
/// Return the minimum of all non-null values in this group.
|
||||
///
|
||||
/// If there are no non-null values in the group, returns null.
|
||||
/// {@macro drift_aggregate_filter}
|
||||
Expression<DateTime> min({Expression<bool?>? filter}) =>
|
||||
Expression<DateTime?> min({Expression<bool?>? filter}) =>
|
||||
_AggregateExpression('MIN', [this], filter: filter);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name: drift
|
||||
description: Drift is a reactive library to store relational data in Dart and Flutter applications.
|
||||
version: 1.8.0-dev
|
||||
version: 2.0.0-dev
|
||||
repository: https://github.com/simolus3/drift
|
||||
homepage: https://drift.simonbinder.eu/
|
||||
issue_tracker: https://github.com/simolus3/drift/issues
|
||||
|
|
Loading…
Reference in New Issue