home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

6 rows where issue = 273678673 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

  • Detect foreign keys and use them to link HTML pages together · 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
345494724 https://github.com/simonw/datasette/issues/85#issuecomment-345494724 https://api.github.com/repos/simonw/datasette/issues/85 MDEyOklzc3VlQ29tbWVudDM0NTQ5NDcyNA== simonw 9599 2017-11-19T06:08:19Z 2017-11-19T06:08:19Z OWNER

This is working really nicely now:

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Detect foreign keys and use them to link HTML pages together 273678673  
345242447 https://github.com/simonw/datasette/issues/85#issuecomment-345242447 https://api.github.com/repos/simonw/datasette/issues/85 MDEyOklzc3VlQ29tbWVudDM0NTI0MjQ0Nw== simonw 9599 2017-11-17T13:22:33Z 2017-11-17T13:23:14Z OWNER

I could support explicit label columns using additional arguments to datasette serve:

datasette serve mydb.py --label-column mydb:table1:name --label-column mydb:table2:title

This would mean "in mydb, set the label column for table1 to name, and the label column for table2 to title"

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Detect foreign keys and use them to link HTML pages together 273678673  
345150048 https://github.com/simonw/datasette/issues/85#issuecomment-345150048 https://api.github.com/repos/simonw/datasette/issues/85 MDEyOklzc3VlQ29tbWVudDM0NTE1MDA0OA== simonw 9599 2017-11-17T05:35:25Z 2017-11-17T05:35:25Z OWNER

csvs-to-sqlite is now capable of generating databases with foreign key lookup tables: https://github.com/simonw/csvs-to-sqlite/releases/tag/0.3

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Detect foreign keys and use them to link HTML pages together 273678673  
344657040 https://github.com/simonw/datasette/issues/85#issuecomment-344657040 https://api.github.com/repos/simonw/datasette/issues/85 MDEyOklzc3VlQ29tbWVudDM0NDY1NzA0MA== simonw 9599 2017-11-15T16:56:48Z 2017-11-15T16:56:48Z OWNER

Since detecting foreign keys that point to a specific table is a bit expensive (you have to call a PRAGMA on every other table) I’m going to add this to the build/inspect stage.

Idea: if we detect that the foreign key table only has one other column in it (id, name) AND we know that the id is the primary key, we can add an efficient lookup on the table list view and prefetch a dictionary mapping IDs to their value. Then we can feed that dictionary in as extra tenplate context and use it to render labeled hyperlinks in the corresponding column.

This means our build step should also cache which columns are indexed, and add a “label_column” property for tables with an obvious lane column.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Detect foreign keys and use them to link HTML pages together 273678673  
344452326 https://github.com/simonw/datasette/issues/85#issuecomment-344452326 https://api.github.com/repos/simonw/datasette/issues/85 MDEyOklzc3VlQ29tbWVudDM0NDQ1MjMyNg== simonw 9599 2017-11-15T01:04:38Z 2017-11-15T01:04:38Z OWNER

This will work well in conjunction with https://github.com/simonw/csvs-to-sqlite/issues/2

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Detect foreign keys and use them to link HTML pages together 273678673  
344452063 https://github.com/simonw/datasette/issues/85#issuecomment-344452063 https://api.github.com/repos/simonw/datasette/issues/85 MDEyOklzc3VlQ29tbWVudDM0NDQ1MjA2Mw== simonw 9599 2017-11-15T01:03:03Z 2017-11-15T01:03:03Z OWNER

This can work in reverse too. If you view the row page for something that has foreign keys against it, we can show you “53 items in TABLE link to this” and provide a link to view them all.

That count worry could be prohibitively expensive. To counter that, we could run the count query via Ajax and set a strict time limit on it. See #95

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Detect foreign keys and use them to link HTML pages together 273678673  

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