home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

7 rows where author_association = "OWNER", issue = 313837303 and user = 9599 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 · 7 ✖

issue 1

  • Support for units · 7 ✖

author_association 1

  • OWNER · 7 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
381446554 https://github.com/simonw/datasette/issues/203#issuecomment-381446554 https://api.github.com/repos/simonw/datasette/issues/203 MDEyOklzc3VlQ29tbWVudDM4MTQ0NjU1NA== simonw 9599 2018-04-15T23:25:54Z 2018-04-15T23:26:03Z OWNER

I built a prototype of the convert_units() custom SQL function as a plugin over in https://github.com/simonw/datasette/issues/14#issuecomment-381446511

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support for units 313837303  
381348849 https://github.com/simonw/datasette/issues/203#issuecomment-381348849 https://api.github.com/repos/simonw/datasette/issues/203 MDEyOklzc3VlQ29tbWVudDM4MTM0ODg0OQ== simonw 9599 2018-04-14T18:12:52Z 2018-04-14T18:12:52Z OWNER

I think I'm going to hold on to the custom sql function idea for the moment and implement it as an example plugin.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support for units 313837303  
381330075 https://github.com/simonw/datasette/issues/203#issuecomment-381330075 https://api.github.com/repos/simonw/datasette/issues/203 MDEyOklzc3VlQ29tbWVudDM4MTMzMDA3NQ== simonw 9599 2018-04-14T13:41:53Z 2018-04-14T13:41:53Z OWNER

Presumably units only work for numeric fields? If that's the case then automatically processing them if the incoming query string argument has a unit suffix makes total sense to me.

Here's a pretty crazy idea: what if we exposed unit conversion to SQL as a custom SQLite function? That way it would be possible to optionally use units in actual custom SQL queries.

I'd have to think quite carefully about performance implications here - wouldn't want a poorly considered unit calculation over a 500,000 row table to lock up the server. But I think the 1s query time limit might still prevent that.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support for units 313837303  
381300386 https://github.com/simonw/datasette/issues/203#issuecomment-381300386 https://api.github.com/repos/simonw/datasette/issues/203 MDEyOklzc3VlQ29tbWVudDM4MTMwMDM4Ng== simonw 9599 2018-04-14T03:35:56Z 2018-04-14T03:35:56Z OWNER

In #204 you said "I'd like to add support for using units when querying but this is PR is pretty usable as-is." - I'm fascinated to hear more about how this could work.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support for units 313837303  
381300336 https://github.com/simonw/datasette/issues/203#issuecomment-381300336 https://api.github.com/repos/simonw/datasette/issues/203 MDEyOklzc3VlQ29tbWVudDM4MTMwMDMzNg== simonw 9599 2018-04-14T03:35:02Z 2018-04-14T03:35:02Z OWNER

This is really cool - I'm very impressed by pint.

I'd like to figure out a sensible opt-in way to expose this in the JSON output as well. Maybe with a &_units=true parameter?

We should definitely expose the units section from the table metadata in the output of https://wtr-api.herokuapp.com/wtr-663ea99/license_frequency.json

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support for units 313837303  
380951920 https://github.com/simonw/datasette/issues/203#issuecomment-380951920 https://api.github.com/repos/simonw/datasette/issues/203 MDEyOklzc3VlQ29tbWVudDM4MDk1MTkyMA== simonw 9599 2018-04-12T21:36:38Z 2018-04-12T21:36:38Z OWNER

This also feeds into the visualization features I want to add - we could use this kind of metadata to automatically apply meaningful labels to graphs.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support for units 313837303  
380951815 https://github.com/simonw/datasette/issues/203#issuecomment-380951815 https://api.github.com/repos/simonw/datasette/issues/203 MDEyOklzc3VlQ29tbWVudDM4MDk1MTgxNQ== simonw 9599 2018-04-12T21:36:10Z 2018-04-12T21:36:10Z OWNER

I like this. I'd like to be able to attach a full description to a column as well. We could support these in metadata.json

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support for units 313837303  

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