home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

8 rows where issue = 438437973 sorted by updated_at descending

✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 2

  • russss 6
  • simonw 2

author_association 2

  • CONTRIBUTOR 6
  • OWNER 2

issue 1

  • Add register_output_renderer hook · 8 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
488373631 https://github.com/simonw/datasette/pull/441#issuecomment-488373631 https://api.github.com/repos/simonw/datasette/issues/441 MDEyOklzc3VlQ29tbWVudDQ4ODM3MzYzMQ== simonw 9599 2019-05-01T18:43:17Z 2019-05-01T18:43:17Z OWNER

I plan to merge this in about 7 hours time (after work).

I may tweak the plugin format a little bit before the next Datasette release though (best to merge first, make changes later I think) - for consistency with some other upcoming hooks (the facet hook in particular). I'll discuss that with you while I'm working on it.

Thanks so much for this, it's a really neat addition!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Add register_output_renderer hook 438437973  
488247617 https://github.com/simonw/datasette/pull/441#issuecomment-488247617 https://api.github.com/repos/simonw/datasette/issues/441 MDEyOklzc3VlQ29tbWVudDQ4ODI0NzYxNw== russss 45057 2019-05-01T09:57:50Z 2019-05-01T09:57:50Z CONTRIBUTOR

Just for the record, this PR is now finished and ready to merge from my perspective.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Add register_output_renderer hook 438437973  
487748271 https://github.com/simonw/datasette/pull/441#issuecomment-487748271 https://api.github.com/repos/simonw/datasette/issues/441 MDEyOklzc3VlQ29tbWVudDQ4Nzc0ODI3MQ== russss 45057 2019-04-29T21:20:17Z 2019-04-29T21:20:17Z CONTRIBUTOR

Also I just pushed a change to add registered output renderers to the templates:

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Add register_output_renderer hook 438437973  
487735247 https://github.com/simonw/datasette/pull/441#issuecomment-487735247 https://api.github.com/repos/simonw/datasette/issues/441 MDEyOklzc3VlQ29tbWVudDQ4NzczNTI0Nw== russss 45057 2019-04-29T20:39:43Z 2019-04-29T20:39:43Z CONTRIBUTOR

I updated the hook to pass the datasette object through now.

You can see the working GeoJSON render function here - the hook function is here.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Add register_output_renderer hook 438437973  
487724539 https://github.com/simonw/datasette/pull/441#issuecomment-487724539 https://api.github.com/repos/simonw/datasette/issues/441 MDEyOklzc3VlQ29tbWVudDQ4NzcyNDUzOQ== russss 45057 2019-04-29T20:08:32Z 2019-04-29T20:08:32Z CONTRIBUTOR

I also just realised that I should be passing the datasette object into the hook function...as I just found I need it. So hold off merging until I've fixed that.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Add register_output_renderer hook 438437973  
487723476 https://github.com/simonw/datasette/pull/441#issuecomment-487723476 https://api.github.com/repos/simonw/datasette/issues/441 MDEyOklzc3VlQ29tbWVudDQ4NzcyMzQ3Ng== russss 45057 2019-04-29T20:05:23Z 2019-04-29T20:05:23Z CONTRIBUTOR

This is the minimal example (I also included it in the docs):

```python from datasette import hookimpl

def render_test(args, data, view_name): return {   'body': 'Hello World', 'content_type': 'text/plain' }

@hookimpl def register_output_renderer(): return { 'extension': 'test', 'callback': render_test } ```

I'm working on the GeoJSON one now and it should be ready soon. (I forgot I was going to run into the same problem as before - that Spatialite's stupid binary format isn't WKB and I have no way of altering the query to change that - but I've just managed to write some code to rearrange the bytes from Spatialite blob-geometry into WKB...)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Add register_output_renderer hook 438437973  
487721095 https://github.com/simonw/datasette/pull/441#issuecomment-487721095 https://api.github.com/repos/simonw/datasette/issues/441 MDEyOklzc3VlQ29tbWVudDQ4NzcyMTA5NQ== simonw 9599 2019-04-29T19:57:55Z 2019-04-29T19:57:55Z OWNER

Do you have an example renderer plugin I can look at?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Add register_output_renderer hook 438437973  
487686655 https://github.com/simonw/datasette/pull/441#issuecomment-487686655 https://api.github.com/repos/simonw/datasette/issues/441 MDEyOklzc3VlQ29tbWVudDQ4NzY4NjY1NQ== russss 45057 2019-04-29T18:14:25Z 2019-04-29T18:14:25Z CONTRIBUTOR

Subsidiary note which I forgot in the commit message:

I've decided to give each view a short string name to aid in differentiating which view a hook is being called from. Since hooks are functions and not subclasses, and can get called from different places in the URL hierarchy, it's sometimes difficult to distinguish what data you're actually operating on. I think this will come in handy for other hooks as well.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Add register_output_renderer hook 438437973  

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