icydb-core 0.264.3

IcyDB — A schema-first typed query engine and persistence runtime for Internet Computer canisters
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::db::query::builder::AggregateExpr;

// Preserve the parsed DISTINCT marker on the aggregate expression exactly once.
// Runtime strategy construction later decides whether that marker has observable
// reducer semantics for the specific aggregate family.
#[must_use]
pub(in crate::db::sql::lowering::aggregate) const fn apply_distinct_marker(
    aggregate: AggregateExpr,
    distinct: bool,
) -> AggregateExpr {
    if distinct {
        aggregate.distinct()
    } else {
        aggregate
    }
}