select
date_trunc('week',createdat) as date,
count(distinct author) as num_developers,
count(distinct id) as num_prs,
count(distinct repo) as num_repos,
sum(num_prs) over (order by date asc rows between unbounded preceding and current row) as cum_n_prs
from near.beta.github_activity
group by 1
order by date desc