home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

9 rows where issue = 640917326 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 9

issue 1

  • canned_queries() plugin hook · 9 ✖

author_association 1

  • OWNER 9
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
646905073 https://github.com/simonw/datasette/issues/852#issuecomment-646905073 https://api.github.com/repos/simonw/datasette/issues/852 MDEyOklzc3VlQ29tbWVudDY0NjkwNTA3Mw== simonw 9599 2020-06-20T00:21:34Z 2020-06-20T00:22:28Z OWNER

New repo: https://github.com/simonw/datasette-saved-queries - which I created using the new cookiecutter template at https://github.com/simonw/datasette-plugin

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
canned_queries() plugin hook 640917326  
646760805 https://github.com/simonw/datasette/issues/852#issuecomment-646760805 https://api.github.com/repos/simonw/datasette/issues/852 MDEyOklzc3VlQ29tbWVudDY0Njc2MDgwNQ== simonw 9599 2020-06-19T17:07:45Z 2020-06-19T17:07:45Z OWNER

Plugin idea: datasette-saved-queries - it uses the startup hook to initialize a saved_queries table, then uses the canned_queries hook to add a writable canned query for saving records to that table.

Then it returns any queries from that table as additional canned queries.

Bonus idea: it could write the user's actor_id to a column if they are signed in, and provide a link to see "just my saved queries" in that case.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
canned_queries() plugin hook 640917326  
646396772 https://github.com/simonw/datasette/issues/852#issuecomment-646396772 https://api.github.com/repos/simonw/datasette/issues/852 MDEyOklzc3VlQ29tbWVudDY0NjM5Njc3Mg== simonw 9599 2020-06-19T02:16:47Z 2020-06-19T02:16:47Z OWNER

I'll close this once I've built a plugin against it.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
canned_queries() plugin hook 640917326  
646396690 https://github.com/simonw/datasette/issues/852#issuecomment-646396690 https://api.github.com/repos/simonw/datasette/issues/852 MDEyOklzc3VlQ29tbWVudDY0NjM5NjY5MA== simonw 9599 2020-06-19T02:16:24Z 2020-06-19T02:16:24Z OWNER

Documentation: https://datasette.readthedocs.io/en/latest/plugins.html#canned-queries-datasette-database-actor

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
canned_queries() plugin hook 640917326  
646396499 https://github.com/simonw/datasette/issues/852#issuecomment-646396499 https://api.github.com/repos/simonw/datasette/issues/852 MDEyOklzc3VlQ29tbWVudDY0NjM5NjQ5OQ== simonw 9599 2020-06-19T02:15:49Z 2020-06-19T02:15:58Z OWNER

Released an alpha preview in https://github.com/simonw/datasette/releases/tag/0.45a1

Wrote about this here: https://simonwillison.net/2020/Jun/19/datasette-alphas/

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
canned_queries() plugin hook 640917326  
646350530 https://github.com/simonw/datasette/issues/852#issuecomment-646350530 https://api.github.com/repos/simonw/datasette/issues/852 MDEyOklzc3VlQ29tbWVudDY0NjM1MDUzMA== simonw 9599 2020-06-18T23:13:57Z 2020-06-18T23:14:11Z OWNER

python @hookspec def canned_queries(datasette, database, actor): "Return a dictionary of canned query definitions or an awaitable function that returns them"

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
canned_queries() plugin hook 640917326  
646329456 https://github.com/simonw/datasette/issues/852#issuecomment-646329456 https://api.github.com/repos/simonw/datasette/issues/852 MDEyOklzc3VlQ29tbWVudDY0NjMyOTQ1Ng== simonw 9599 2020-06-18T22:07:09Z 2020-06-18T22:07:37Z OWNER

It would be neat if the queries returned by this hook could be restricted to specific users. I think I can do that by returning an "allow" block as part of the query.

But... what if we allow users to save private queries and we might have thousands of users each with hundreds of saved queries?

For that case it would be good if the plugin hook could take an optional actor parameter.

This would also allow us to dynamically generate a canned query for "return the bookmarks belonging to this actor" or similar!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
canned_queries() plugin hook 640917326  
645785830 https://github.com/simonw/datasette/issues/852#issuecomment-645785830 https://api.github.com/repos/simonw/datasette/issues/852 MDEyOklzc3VlQ29tbWVudDY0NTc4NTgzMA== simonw 9599 2020-06-18T05:37:00Z 2020-06-18T05:37:00Z OWNER

The easiest way to do this would be with a new plugin hook:

def canned_queries(datasette, database):
    """Return a list of canned query definitions
    or an awaitable function that returns them"

Another approach would be to make the whole of metadata.json customizable by plugins.

I think I like the dedicated canned_queries option better. I'm not happy with the way metadata keeps growing - see #493 - so adding a dedicated hook would be more future proof against other changes I might make to the metadata mechanism.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
canned_queries() plugin hook 640917326  
645781482 https://github.com/simonw/datasette/issues/852#issuecomment-645781482 https://api.github.com/repos/simonw/datasette/issues/852 MDEyOklzc3VlQ29tbWVudDY0NTc4MTQ4Mg== simonw 9599 2020-06-18T05:24:55Z 2020-06-18T05:25:00Z OWNER

Question about this on Twitter: https://twitter.com/amjithr/status/1273440766862352384

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
canned_queries() plugin hook 640917326  

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