-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
github-to-sqlite tags command for fetching tags #43
Labels
enhancement
New feature or request
Comments
I want to create a SQL query which shows me all of my repositories that have commits that are NOT in the most recent release. The releases table doesn't have enough information for this because it doesn't tell you the commit hash associated with each release, just the tag: https://github-to-sqlite.dogsheep.net/github/releases |
|
with most_recent_releases as (
with ranked as (
select
repo,
tag_name,
published_at,
row_number() OVER (
partition BY repo
ORDER BY
published_at DESC
) rank
FROM
releases
)
select
*
from
ranked
where
rank = 1
)
select
repos.full_name as repo,
most_recent_releases.tag_name as release,
commits.committer_date as release_commit_date,
(
select
count(*)
from
commits c2
where
c2.repo = repos.id
and c2.committer_date > commits.committer_date
) as commits_since_release,
'https://github.com/' || repos.full_name || '/compare/' || most_recent_releases.tag_name || '...' || repos.default_branch as view_commits
from
most_recent_releases
join repos on most_recent_releases.repo = repos.id
join tags on tags.repo = repos.id
and tags.name = most_recent_releases.tag_name
join commits on tags.sha = commits.sha
order by
commits_since_release desc
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fetches paginated data from https://api.github.com/repos/simonw/datasette/tags
The text was updated successfully, but these errors were encountered: