Skip to content
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

View that combines issues and issue comments #69

Open
simonw opened this issue Dec 4, 2021 · 1 comment
Open

View that combines issues and issue comments #69

simonw opened this issue Dec 4, 2021 · 1 comment
Labels

Comments

@simonw
Copy link
Collaborator

simonw commented Dec 4, 2021

I want to see a reverse chronologically ordered interface onto both issues and comments - essentially a unified log of comments and issues opened across one or multiple projects.

@simonw simonw added the research label Dec 4, 2021
@simonw
Copy link
Collaborator Author

simonw commented Dec 4, 2021

First attempt at this:

select 'issues' as "table", id, node_id, title, user, created_at, body, repo
from issues
union all
select 'issue_comments' as "table", issue_comments.id, issue_comments.node_id, '' as title, issue_comments.user, issue_comments.created_at, issue_comments.body, issues.repo
from issue_comments join issues on issues.id = issue_comments.issue
order by created_at desc

https://github-to-sqlite.dogsheep.net/github?sql=select+%27issues%27+as+%22table%22%2C+id%2C+node_id%2C+title%2C+user%2C+created_at%2C+body%2C+repo%0D%0Afrom+issues%0D%0Aunion+all%0D%0Aselect+%27issue_comments%27+as+%22table%22%2C+issue_comments.id%2C+issue_comments.node_id%2C+%27%27+as+title%2C+issue_comments.user%2C+issue_comments.created_at%2C+issue_comments.body%2C+issues.repo%0D%0Afrom+issue_comments+join+issues+on+issues.id+%3D+issue_comments.issue%0D%0Aorder+by+created_at+desc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant