MssqlWindowFrame constructor
MssqlWindowFrame({
- required MssqlFrameUnit unit,
- required MssqlFrameBound start,
- required MssqlFrameBound end,
Implementation
MssqlWindowFrame({
required this.unit,
required this.start,
required this.end,
}) {
if (unit == MssqlFrameUnit.range &&
(start.offset != null || end.offset != null)) {
throw ArgumentError.value(
unit,
'unit',
'SQL Server\'s RANGE accepts only UNBOUNDED and CURRENT ROW, never '
'an offset: RANGE BETWEEN 3 PRECEDING is rejected. Use '
'MssqlFrameUnit.rows for a count of rows.',
);
}
if (start == MssqlFrameBound.unboundedFollowing) {
throw ArgumentError.value(
start,
'start',
'a frame cannot start after the end of its partition.',
);
}
if (end == MssqlFrameBound.unboundedPreceding) {
throw ArgumentError.value(
end,
'end',
'a frame cannot end before the start of its partition.',
);
}
}