results = username.trim() &&
(
await fetch("https://play.clickhouse.com/?user=play", {
method: "POST",
body: `with public_events as (
select
created_at as timestamp,
'Private repo made public' as action,
repo_name
from github_events
where lower(actor_login) = '${username.trim().toLowerCase()}'
and event_type in ('PublicEvent')
),
most_recent_public_push as (
select
max(created_at) as timestamp,
'Most recent public push' as action,
repo_name
from github_events
where event_type = 'PushEvent'
and lower(actor_login) = '${username.trim().toLowerCase()}'
group by repo_name
),
combined as (
select * from public_events
union all select * from most_recent_public_push
)
select * from combined order by timestamp FORMAT JSON`
})
).json()