home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

11 rows where issue = 534492501 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 · 11 ✖

issue 1

  • Mechanism for adding arbitrary pages like /about · 11 ✖

author_association 1

  • OWNER 11
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
619612675 https://github.com/simonw/datasette/issues/648#issuecomment-619612675 https://api.github.com/repos/simonw/datasette/issues/648 MDEyOklzc3VlQ29tbWVudDYxOTYxMjY3NQ== simonw 9599 2020-04-26T19:35:09Z 2020-04-26T19:35:09Z OWNER

https://www.niche-museums.com/about now uses this mechanism. It used to be an empty about.db database but you can see from https://www.niche-museums.com/-/databases that it's now using the new mechanism.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for adding arbitrary pages like /about 534492501  
619604720 https://github.com/simonw/datasette/issues/648#issuecomment-619604720 https://api.github.com/repos/simonw/datasette/issues/648 MDEyOklzc3VlQ29tbWVudDYxOTYwNDcyMA== simonw 9599 2020-04-26T18:50:30Z 2020-04-26T18:50:30Z OWNER

Documentation: https://datasette.readthedocs.io/en/latest/custom_templates.html#custom-pages

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for adding arbitrary pages like /about 534492501  
619591380 https://github.com/simonw/datasette/issues/648#issuecomment-619591380 https://api.github.com/repos/simonw/datasette/issues/648 MDEyOklzc3VlQ29tbWVudDYxOTU5MTM4MA== simonw 9599 2020-04-26T17:33:04Z 2020-04-26T17:33:04Z OWNER

Stretch goal: it would be neat if these pages could return custom HTTP headers (eg content-type) and maybe even status codes (eg for redirects) somehow.

I think I could do that with a custom template function - if that function is called during the render then we follow those instructions instead of returning the rendered HTML.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for adding arbitrary pages like /about 534492501  
619263600 https://github.com/simonw/datasette/issues/648#issuecomment-619263600 https://api.github.com/repos/simonw/datasette/issues/648 MDEyOklzc3VlQ29tbWVudDYxOTI2MzYwMA== simonw 9599 2020-04-24T22:23:13Z 2020-04-24T22:23:13Z OWNER

Idea: handle_404 can hand certain not found errors off to handle_500 so it can render them correctly;

https://github.com/simonw/datasette/blob/227bb3e91fe34811a9374150798643a5af98ed79/datasette/app.py#L748-L765

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for adding arbitrary pages like /about 534492501  
619259859 https://github.com/simonw/datasette/issues/648#issuecomment-619259859 https://api.github.com/repos/simonw/datasette/issues/648 MDEyOklzc3VlQ29tbWVudDYxOTI1OTg1OQ== simonw 9599 2020-04-24T22:10:34Z 2020-04-24T22:10:34Z OWNER

The trickiest part here is the 404 logic. It's spread out through a couple of places right now. It's in datasette.utils.asgi.AsgiRouter:

https://github.com/simonw/datasette/blob/227bb3e91fe34811a9374150798643a5af98ed79/datasette/utils/asgi.py#L98-L134

Then also in the `DatasetteRouter subclass of that:

https://github.com/simonw/datasette/blob/227bb3e91fe34811a9374150798643a5af98ed79/datasette/app.py#L736-L757

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for adding arbitrary pages like /about 534492501  
618775631 https://github.com/simonw/datasette/issues/648#issuecomment-618775631 https://api.github.com/repos/simonw/datasette/issues/648 MDEyOklzc3VlQ29tbWVudDYxODc3NTYzMQ== simonw 9599 2020-04-24T03:03:35Z 2020-04-24T03:03:35Z OWNER

Stretch goal: it would be neat if these pages could return custom HTTP headers (eg content-type) and maybe even status codes (eg for redirects) somehow.

I think I could do that with a custom template function - if that function is called during the render then we follow those instructions instead of returning the rendered HTML.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for adding arbitrary pages like /about 534492501  
618775028 https://github.com/simonw/datasette/issues/648#issuecomment-618775028 https://api.github.com/repos/simonw/datasette/issues/648 MDEyOklzc3VlQ29tbWVudDYxODc3NTAyOA== simonw 9599 2020-04-24T03:01:32Z 2020-04-24T03:01:32Z OWNER

Now that I've closed #577 this should be pretty easy to implement.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for adding arbitrary pages like /about 534492501  
563015290 https://github.com/simonw/datasette/issues/648#issuecomment-563015290 https://api.github.com/repos/simonw/datasette/issues/648 MDEyOklzc3VlQ29tbWVudDU2MzAxNTI5MA== simonw 9599 2019-12-09T00:18:17Z 2019-12-09T00:18:17Z OWNER

The implementation in https://github.com/simonw/datasette/commit/c5e8cd84d3ef55ed86771ac0bde0ca91d6b0e07a acts as a proof of concept. It has a big flaw though: it doesn't reuse the regular render() mechanism, which means it doesn't register custom template tags from plugins.

This is bad because it means that pages rendered in this way cannot take advantage of things like datasette-template-sql.

This means this issue is likely dependent on #577 - a documented mechanism to allow plugins to render templates.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for adding arbitrary pages like /about 534492501  
563001064 https://github.com/simonw/datasette/issues/648#issuecomment-563001064 https://api.github.com/repos/simonw/datasette/issues/648 MDEyOklzc3VlQ29tbWVudDU2MzAwMTA2NA== simonw 9599 2019-12-08T22:09:20Z 2019-12-08T22:09:20Z OWNER

Stretch goal: it would be neat if these pages could return custom HTTP headers (eg content-type) and maybe even status codes (eg for redirects) somehow.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for adding arbitrary pages like /about 534492501  
563000942 https://github.com/simonw/datasette/issues/648#issuecomment-563000942 https://api.github.com/repos/simonw/datasette/issues/648 MDEyOklzc3VlQ29tbWVudDU2MzAwMDk0Mg== simonw 9599 2019-12-08T22:08:14Z 2019-12-08T22:08:14Z OWNER

Alternative idea: a new concept of "pages" which live inside templates/pages/ and where the file name minus the .html extension defines the URL.

templates/about/me.html would be served at /about/me - but only if no matching database and table were found.

This only takes effect on 404 errors from core Datasette.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for adding arbitrary pages like /about 534492501  
562913040 https://github.com/simonw/datasette/issues/648#issuecomment-562913040 https://api.github.com/repos/simonw/datasette/issues/648 MDEyOklzc3VlQ29tbWVudDU2MjkxMzA0MA== simonw 9599 2019-12-08T04:56:43Z 2019-12-08T04:56:43Z OWNER

Idea: do this with a simple template naming convention.

If you hit /about and there is no matching database, check for a template file called about-page.html. If it exists, render it. Otherwise return a 404 database not found.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for adding arbitrary pages like /about 534492501  

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