Path: redb/redb.Core/Query/Aggregation/Win.cs Snapshot: redb, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb Page: https://redbase.app/src/dev-2026-12-06/redb/redb.Core/Query/Aggregation/Win.cs ---- namespace redb.Core.Query.Aggregation; /// /// Static helper for window functions /// Used in Select to create ROW_NUMBER(), RANK(), SUM() OVER(), etc. expressions. /// public static class Win { // ===== RANKING FUNCTIONS ===== /// /// ROW_NUMBER() OVER (...) /// public static long RowNumber() => throw new NotSupportedException("Win.RowNumber must be processed in WindowQueryable"); /// /// RANK() OVER (...) /// public static long Rank() => throw new NotSupportedException("Win.Rank must be processed in WindowQueryable"); /// /// DENSE_RANK() OVER (...) /// public static long DenseRank() => throw new NotSupportedException("Win.DenseRank must be processed in WindowQueryable"); /// /// NTILE(n) OVER (...) /// public static int Ntile(int buckets) => throw new NotSupportedException("Win.Ntile must be processed in WindowQueryable"); // ===== AGGREGATE FUNCTIONS ===== /// /// SUM(field) OVER (...) /// public static decimal Sum(decimal value) => throw new NotSupportedException("Win.Sum must be processed in WindowQueryable"); public static long Sum(long value) => throw new NotSupportedException("Win.Sum must be processed in WindowQueryable"); public static int Sum(int value) => throw new NotSupportedException("Win.Sum must be processed in WindowQueryable"); public static double Sum(double value) => throw new NotSupportedException("Win.Sum must be processed in WindowQueryable"); /// /// AVG(field) OVER (...) /// public static double Avg(decimal value) => throw new NotSupportedException("Win.Avg must be processed in WindowQueryable"); public static double Avg(long value) => throw new NotSupportedException("Win.Avg must be processed in WindowQueryable"); public static double Avg(int value) => throw new NotSupportedException("Win.Avg must be processed in WindowQueryable"); public static double Avg(double value) => throw new NotSupportedException("Win.Avg must be processed in WindowQueryable"); /// /// COUNT(*) OVER (...) /// public static int Count() => throw new NotSupportedException("Win.Count must be processed in WindowQueryable"); /// /// MIN(field) OVER (...) /// public static T Min(T value) => throw new NotSupportedException("Win.Min must be processed in WindowQueryable"); /// /// MAX(field) OVER (...) /// public static T Max(T value) => throw new NotSupportedException("Win.Max must be processed in WindowQueryable"); // ===== OFFSET FUNCTIONS ===== /// /// LAG(field) OVER (...) /// public static T Lag(T value) => throw new NotSupportedException("Win.Lag must be processed in WindowQueryable"); /// /// LEAD(field) OVER (...) /// public static T Lead(T value) => throw new NotSupportedException("Win.Lead must be processed in WindowQueryable"); /// /// FIRST_VALUE(field) OVER (...) /// public static T FirstValue(T value) => throw new NotSupportedException("Win.FirstValue must be processed in WindowQueryable"); /// /// LAST_VALUE(field) OVER (...) /// public static T LastValue(T value) => throw new NotSupportedException("Win.LastValue must be processed in WindowQueryable"); }