home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

4 rows where issue = 320592643 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 4

issue 1

  • Explore "distinct values for column" in inspect() · 4 ✖

author_association 1

  • OWNER 4
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
388987044 https://github.com/simonw/datasette/issues/251#issuecomment-388987044 https://api.github.com/repos/simonw/datasette/issues/251 MDEyOklzc3VlQ29tbWVudDM4ODk4NzA0NA== simonw 9599 2018-05-14T22:47:55Z 2018-05-14T22:47:55Z OWNER

This work is now happening in the facets branch. Closing this in favor of #255.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Explore "distinct values for column" in inspect() 320592643  
386879878 https://github.com/simonw/datasette/issues/251#issuecomment-386879878 https://api.github.com/repos/simonw/datasette/issues/251 MDEyOklzc3VlQ29tbWVudDM4Njg3OTg3OA== simonw 9599 2018-05-06T13:34:57Z 2018-05-06T13:34:57Z OWNER

If I'm going to expand column introspection in this way it would be useful to also capture column type information.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Explore "distinct values for column" in inspect() 320592643  
386879840 https://github.com/simonw/datasette/issues/251#issuecomment-386879840 https://api.github.com/repos/simonw/datasette/issues/251 MDEyOklzc3VlQ29tbWVudDM4Njg3OTg0MA== simonw 9599 2018-05-06T13:34:24Z 2018-05-06T13:34:24Z OWNER

Here's a quick demo of that exploration: https://datasette-distinct-column-values.now.sh/-/inspect

Example output:

{ "antiquities-act/actions_under_antiquities_act": { "columns": [ "current_name", "states", "original_name", "current_agency", "action", "date", "year", "pres_or_congress", "acres_affected" ], "count": 344, "distinct_values_by_column": { "acres_affected": null, "action": null, "current_agency": [ "NPS", "State of Montana", "BLM", "State of Arizona", "USFS", "State of North Dakota", "NPS, BLM", "State of South Carolina", "State of New York", "FWS", "FWS, NOAA", "NPS, FWS", "NOAA", "BLM, USFS", "NOAA, FWS" ], "current_name": null, "date": null, "original_name": null, "pres_or_congress": null, "states": null, "year": null }, "foreign_keys": { "incoming": [], "outgoing": [] }, "fts_table": null, "hidden": false, "label_column": null, "name": "antiquities-act/actions_under_antiquities_act", "primary_keys": [] } }

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Explore "distinct values for column" in inspect() 320592643  
386879509 https://github.com/simonw/datasette/issues/251#issuecomment-386879509 https://api.github.com/repos/simonw/datasette/issues/251 MDEyOklzc3VlQ29tbWVudDM4Njg3OTUwOQ== simonw 9599 2018-05-06T13:29:26Z 2018-05-06T13:29:26Z OWNER

We can solve this using the sqlite_timelimit(conn, 20) helper, which can tell SQLite to give up after 20ms. We can wrap that around the following SQL:

select distinct COLUMN from TABLE limit 21;

Then we look at the number of rows returned. If it's 21 or more we know that this table had more than 21 distinct values, so we'll treat it as "unlimited". Likewise, if the SQL times out before 20ms is up we will skip this introspection.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Explore "distinct values for column" in inspect() 320592643  

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