home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

6 rows where issue = 349827640 sorted by updated_at descending

✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 1

  • simonw 6

issue 1

  • Faceted browse against a JSON list of tags · 6 ✖

author_association 1

  • OWNER 6
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
489076725 https://github.com/simonw/datasette/issues/359#issuecomment-489076725 https://api.github.com/repos/simonw/datasette/issues/359 MDEyOklzc3VlQ29tbWVudDQ4OTA3NjcyNQ== simonw 9599 2019-05-03T12:20:38Z 2019-05-03T12:20:38Z OWNER

Demo: https://latest.datasette.io/fixtures/facetable?_facet_array=tags#facet-tags

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Faceted browse against a JSON list of tags 349827640  
481939013 https://github.com/simonw/datasette/issues/359#issuecomment-481939013 https://api.github.com/repos/simonw/datasette/issues/359 MDEyOklzc3VlQ29tbWVudDQ4MTkzOTAxMw== simonw 9599 2019-04-11T02:17:55Z 2019-04-11T02:17:55Z OWNER

Challenge: facets can also be defined in metadata.json like this:

{ "databases": { "sf-trees": { "tables": { "Street_Tree_List": { "facets": ["qLegalStatus"] } } } } }

But... ?_facet_array=definitions doesn't fit in that data structure. Need to have an alternative mechanism for defining this kind of facet.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Faceted browse against a JSON list of tags 349827640  
481724452 https://github.com/simonw/datasette/issues/359#issuecomment-481724452 https://api.github.com/repos/simonw/datasette/issues/359 MDEyOklzc3VlQ29tbWVudDQ4MTcyNDQ1Mg== simonw 9599 2019-04-10T14:52:59Z 2019-04-10T14:52:59Z OWNER

I'm going to go with ?_facet_array=definitions as the querystring argument for this.

And ?definitions_arraycontains=foo as the filter argument.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Faceted browse against a JSON list of tags 349827640  
412357691 https://github.com/simonw/datasette/issues/359#issuecomment-412357691 https://api.github.com/repos/simonw/datasette/issues/359 MDEyOklzc3VlQ29tbWVudDQxMjM1NzY5MQ== simonw 9599 2018-08-12T17:17:29Z 2018-08-12T17:17:29Z OWNER

Note that there doesn't seem to be a way to use indexes (even indexes on expressions) to speed these up, so this will only ever be effective on smaller data sets, probably in the 10,000-100,000 range. Datasette is often used with smaller data sets so this is still worth pursuing.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Faceted browse against a JSON list of tags 349827640  
412356746 https://github.com/simonw/datasette/issues/359#issuecomment-412356746 https://api.github.com/repos/simonw/datasette/issues/359 MDEyOklzc3VlQ29tbWVudDQxMjM1Njc0Ng== simonw 9599 2018-08-12T17:05:00Z 2018-08-12T17:05:00Z OWNER

And here's the query for pulling back every record tagged with a specific tag:

https://latest-code.datasette.io/code-a26fa3c?sql=select+*+from+definitions+where+rowid+in+%28%0D%0A++select+definitions.rowid%0D%0A++from+definitions+join+json_each%28params%29+j%0D%0A++where+j.value+%3D+%3Atag%0D%0A%29&tag=filename

select * from definitions where rowid in ( select definitions.rowid from definitions join json_each(params) j where j.value = :tag )

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Faceted browse against a JSON list of tags 349827640  
412356537 https://github.com/simonw/datasette/issues/359#issuecomment-412356537 https://api.github.com/repos/simonw/datasette/issues/359 MDEyOklzc3VlQ29tbWVudDQxMjM1NjUzNw== simonw 9599 2018-08-12T17:01:21Z 2018-08-12T17:01:39Z OWNER

Example table: https://latest-code.datasette.io/code/definitions

Here's a query that does facet counting against that column:

https://latest-code.datasette.io/code-a26fa3c?sql=select+count%28*%29+as+n%2C+j.value+from+definitions+join+json_each%28params%29+j+group+by+j.value+order+by+n+desc%3B

select count(*) as n, j.value from definitions join json_each(params) j group by j.value order by n desc;

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Faceted browse against a JSON list of tags 349827640  

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 22.281ms · About: github-to-sqlite
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows