Ejemplo n.º 1
0
 public IAsyncEnumerable <TributesUpdateView> GetTributeUpdatesHourly(TributesQuery opts) =>
 GetTributeUpdatesInner("tributes_hourly", opts);
Ejemplo n.º 2
0
        private IAsyncEnumerable <TributesUpdateView> GetTributeUpdatesInner(string table, TributesQuery opts)
        {
            var q = new SqlKata.Query(table)
                    .SelectRaw("update_id, timestamp, array_agg(player_id) as players, array_agg(peanuts) as peanuts")
                    .GroupBy("timestamp", "update_id")
                    .ApplySorting(opts, "timestamp", "update_id")
                    .ApplyBounds(opts, "timestamp");

            if (opts.Players != null)
            {
                q.WhereIn("player_id", opts.Players);
            }

            return(_db.QueryKataAsync <TributesUpdateView>(q));
        }
Ejemplo n.º 3
0
 public IAsyncEnumerable <TributesUpdateView> GetTributeUpdates(TributesQuery opts) =>
 GetTributeUpdatesInner("tributes_by_player", opts);