home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

15 rows where author_association = "MEMBER" and "created_at" is on date 2020-05-02 sorted by updated_at descending

✖
✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: issue_url, reactions, created_at (date), updated_at (date)

issue 9

  • Command to fetch stargazers for one or more repos 6
  • Add this view for seeing new releases 2
  • stargazers command, refs #4 1
  • Add this repos_starred view 1
  • Fall back to authentication via ENV 1
  • Create index on issue_comments(user) and other foreign keys 1
  • Add view for better display of dependent repos 1
  • Mechanism for creating views if they don't yet exist 1
  • [Feature Request] Support Repo Name in Search 🥺 1

user 1

  • simonw 15

author_association 1

  • MEMBER · 15 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
623027889 https://github.com/dogsheep/github-to-sqlite/issues/38#issuecomment-623027889 https://api.github.com/repos/dogsheep/github-to-sqlite/issues/38 MDEyOklzc3VlQ29tbWVudDYyMzAyNzg4OQ== simonw 9599 2020-05-02T23:15:11Z 2020-05-02T23:15:11Z MEMBER

This is one of the use-cases for the repos_starred view: it allows you to easily run this kid of query without having to construct the SQL by hand. Here's a demo:

https://github-to-sqlite.dogsheep.net/github/repos_starred?name__contains=twitter

My philosophy here is to keep the raw tables (like stars) as normalized as possible, then use SQL views which expose the data in a form that's easier to query.

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 1,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
[Feature Request] Support Repo Name in Search 🥺 611284481  
623010272 https://github.com/dogsheep/github-to-sqlite/issues/4#issuecomment-623010272 https://api.github.com/repos/dogsheep/github-to-sqlite/issues/4 MDEyOklzc3VlQ29tbWVudDYyMzAxMDI3Mg== simonw 9599 2020-05-02T20:39:14Z 2020-05-02T20:39:14Z MEMBER

Graph of cumulative stars for Datasette over time: https://github-to-sqlite.dogsheep.net/github?sql=select%0D%0A++yyyymmdd%2C%0D%0A++sum%28n%29+over+%28%0D%0A++++order+by%0D%0A++++++yyyymmdd+rows+unbounded+preceding%0D%0A++%29+as+cumulative_count%0D%0Afrom%0D%0A++%28%0D%0A++++select%0D%0A++++++substr%28starred_at%2C+0%2C+11%29+as+yyyymmdd%2C%0D%0A++++++count%28*%29+as+n%0D%0A++++from%0D%0A++++++stars%0D%0A++++where+repo+%3D+107914493%0D%0A++++group+by%0D%0A++++++yyyymmdd%0D%0A++%29#g.mark=line&g.x_column=yyyymmdd&g.x_type=temporal&g.y_column=cumulative_count&g.y_type=quantitative

Stars per day (as a label bar chart, so very wide):

https://github-to-sqlite.dogsheep.net/github?sql=%0D%0A++++select%0D%0A++++++substr%28starred_at%2C+0%2C+11%29+as+yyyymmdd%2C%0D%0A++++++count%28*%29+as+n%0D%0A++++from%0D%0A++++++stars%0D%0A++++where+repo+%3D+107914493%0D%0A++++group+by%0D%0A++++++yyyymmdd%0D%0A++#g.mark=bar&g.x_column=yyyymmdd&g.x_type=ordinal&g.y_column=n&g.y_type=quantitative

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Command to fetch stargazers for one or more repos 493670730  
623007441 https://github.com/dogsheep/github-to-sqlite/issues/4#issuecomment-623007441 https://api.github.com/repos/dogsheep/github-to-sqlite/issues/4 MDEyOklzc3VlQ29tbWVudDYyMzAwNzQ0MQ== simonw 9599 2020-05-02T20:13:37Z 2020-05-02T20:13:37Z MEMBER

Datasette cumulative stars over time: https://github-to-sqlite.dogsheep.net/github?sql=select%0D%0A++yyyymmdd%2C%0D%0A++sum%28n%29+over+%28%0D%0A++++order+by%0D%0A++++++yyyymmdd+rows+unbounded+preceding%0D%0A++%29+as+cumulative_count%0D%0Afrom%0D%0A++%28%0D%0A++++select%0D%0A++++++substr%28starred_at%2C+0%2C+11%29+as+yyyymmdd%2C%0D%0A++++++count%28*%29+as+n%0D%0A++++from%0D%0A++++++stars%0D%0A++++where+repo+%3D+107914493%0D%0A++++group+by%0D%0A++++++yyyymmdd%0D%0A++%29

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Command to fetch stargazers for one or more repos 493670730  
623006154 https://github.com/dogsheep/github-to-sqlite/issues/4#issuecomment-623006154 https://api.github.com/repos/dogsheep/github-to-sqlite/issues/4 MDEyOklzc3VlQ29tbWVudDYyMzAwNjE1NA== simonw 9599 2020-05-02T20:01:39Z 2020-05-02T20:01:54Z MEMBER

Needs tests and documentation. I shipped it early to check that the live demo works.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Command to fetch stargazers for one or more repos 493670730  
623006004 https://github.com/dogsheep/github-to-sqlite/pull/8#issuecomment-623006004 https://api.github.com/repos/dogsheep/github-to-sqlite/issues/8 MDEyOklzc3VlQ29tbWVudDYyMzAwNjAwNA== simonw 9599 2020-05-02T20:00:26Z 2020-05-02T20:00:26Z MEMBER

I'm abandoning this in favour of a new implementation.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
stargazers command, refs #4 516763727  
623004836 https://github.com/dogsheep/github-to-sqlite/issues/4#issuecomment-623004836 https://api.github.com/repos/dogsheep/github-to-sqlite/issues/4 MDEyOklzc3VlQ29tbWVudDYyMzAwNDgzNg== simonw 9599 2020-05-02T19:49:51Z 2020-05-02T19:49:51Z MEMBER

Alternative pattern: sqlite-utils releases.db 'select full_name from repos' --csv --no-headers \ | tr -d '\r' \ | xargs github-to-sqlite stargazers stars.db

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Command to fetch stargazers for one or more repos 493670730  
623000814 https://github.com/dogsheep/github-to-sqlite/issues/4#issuecomment-623000814 https://api.github.com/repos/dogsheep/github-to-sqlite/issues/4 MDEyOklzc3VlQ29tbWVudDYyMzAwMDgxNA== simonw 9599 2020-05-02T19:15:23Z 2020-05-02T19:15:23Z MEMBER

I'm not going to do the --sql bit just yet. I have patterns for working around this for other commands which are working fine:

https://github.com/dogsheep/github-to-sqlite/blob/d00a53061556dc403c166b443d141c4e1adbd64a/.github/workflows/deploy-demo.yml#L53-L70

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Command to fetch stargazers for one or more repos 493670730  
622998813 https://github.com/dogsheep/github-to-sqlite/issues/12#issuecomment-622998813 https://api.github.com/repos/dogsheep/github-to-sqlite/issues/12 MDEyOklzc3VlQ29tbWVudDYyMjk5ODgxMw== simonw 9599 2020-05-02T18:58:17Z 2020-05-02T18:58:17Z MEMBER

Faceting works now: https://github-to-sqlite.dogsheep.net/github/recent_releases?_facet_array=topics&topics__arraycontains=datasette-io&topics__arraycontains=sqlite&_facet=repo#facet-repo

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Add this view for seeing new releases 520756546  
622997410 https://github.com/dogsheep/github-to-sqlite/issues/33#issuecomment-622997410 https://api.github.com/repos/dogsheep/github-to-sqlite/issues/33 MDEyOklzc3VlQ29tbWVudDYyMjk5NzQxMA== simonw 9599 2020-05-02T18:46:10Z 2020-05-02T18:46:10Z MEMBER

Documented here: https://github.com/dogsheep/github-to-sqlite/blob/10fb34de41aaa35681f08b5991540d65bfcf2e2e/README.md#authentication

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Fall back to authentication via ENV 609950090  
622990947 https://github.com/dogsheep/github-to-sqlite/issues/4#issuecomment-622990947 https://api.github.com/repos/dogsheep/github-to-sqlite/issues/4 MDEyOklzc3VlQ29tbWVudDYyMjk5MDk0Nw== simonw 9599 2020-05-02T17:54:16Z 2020-05-02T17:54:16Z MEMBER

I could add that window function query as a view, but only if the detected version of SQLite supports window functions.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Command to fetch stargazers for one or more repos 493670730  
622989874 https://github.com/dogsheep/github-to-sqlite/issues/12#issuecomment-622989874 https://api.github.com/repos/dogsheep/github-to-sqlite/issues/12 MDEyOklzc3VlQ29tbWVudDYyMjk4OTg3NA== simonw 9599 2020-05-02T17:46:14Z 2020-05-02T17:46:14Z MEMBER

Without the rowid column facet by topics breaks: https://github-to-sqlite.dogsheep.net/github/recent_releases?_facet=repo&_facet_array=topics&topics__arraycontains=datasette-io

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Add this view for seeing new releases 520756546  
622982667 https://github.com/dogsheep/github-to-sqlite/issues/35#issuecomment-622982667 https://api.github.com/repos/dogsheep/github-to-sqlite/issues/35 MDEyOklzc3VlQ29tbWVudDYyMjk4MjY2Nw== simonw 9599 2020-05-02T16:52:53Z 2020-05-02T16:52:53Z MEMBER

Easiest option: use db.index_foreign_keys(): https://sqlite-utils.readthedocs.io/en/stable/python-api.html#adding-indexes-for-all-foreign-keys

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Create index on issue_comments(user) and other foreign keys 610511450  
622982346 https://github.com/dogsheep/github-to-sqlite/issues/36#issuecomment-622982346 https://api.github.com/repos/dogsheep/github-to-sqlite/issues/36 MDEyOklzc3VlQ29tbWVudDYyMjk4MjM0Ng== simonw 9599 2020-05-02T16:50:31Z 2020-05-02T16:50:31Z MEMBER

Demo: https://github-to-sqlite.dogsheep.net/github/dependent_repos

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Add view for better display of dependent repos 610842926  
622980203 https://github.com/dogsheep/github-to-sqlite/issues/10#issuecomment-622980203 https://api.github.com/repos/dogsheep/github-to-sqlite/issues/10 MDEyOklzc3VlQ29tbWVudDYyMjk4MDIwMw== simonw 9599 2020-05-02T16:34:29Z 2020-05-02T16:34:29Z MEMBER

Fixed definition: sql select stars.starred_at, starring_user.login as starred_by, repos.* from repos join stars on repos.id = stars.repo join users as starring_user on stars.user = starring_user.id join users on repos.owner = users.id order by starred_at desc;

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Add this repos_starred view 516967682  
622978173 https://github.com/dogsheep/github-to-sqlite/issues/37#issuecomment-622978173 https://api.github.com/repos/dogsheep/github-to-sqlite/issues/37 MDEyOklzc3VlQ29tbWVudDYyMjk3ODE3Mw== simonw 9599 2020-05-02T16:19:31Z 2020-05-02T16:19:47Z MEMBER

I can use the new .create_view(..., replace=True) parameter in sqlite-utils 2.7.2 for this.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for creating views if they don't yet exist 610843136  

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
, [performed_via_github_app] TEXT);
CREATE INDEX [idx_issue_comments_issue]
                ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
                ON [issue_comments] ([user]);
Powered by Datasette · Queries took 795.967ms · About: github-to-sqlite
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows