Build interval where
buildIntervalWhere, IntervalFields: generated from the source of active-grid.
Exported by @workspace/. Generated from the package source; part of the index of every export.
Functions, hooks and constants#
Builds a Prisma-shaped where fragment for an Interval over two numeric boundary fields. Pure and framework-neutral: it emits a plain object (no Prisma import, no domain knowledge) that a server resolver composes into its query.
Semantics (numeric set-relations between the row interval [lo, hi] and the query range [from, to], where an unset query bound means open on that side):
within(containment):lo >= from AND hi <= tofor each given bound. Agte/lteconstraint excludes a null row bound by construction, so an open-ended row (anulllo or hi) never matches a closed query side. With both bounds given this is exactly the "fully inside" rule.overlap: the row touches the range. A null row bound counts as reaching to infinity on that side and therefore always overlaps there.
Returns undefined when the filter is inactive (both from and to null), so the caller can skip it.
(value: IntervalFilterValue, fields: IntervalFields) => Record<string, unknown> | undefinedTypes#
The two numeric boundary fields a row's interval is stored in.
interface IntervalFields {
loField: string;
hiField: string;
}