home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

5 rows where author_association = "OWNER", issue = 681516976 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 · 5 ✖

issue 1

  • Path parameters for custom pages · 5 ✖

author_association 1

  • OWNER · 5 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
691788478 https://github.com/simonw/datasette/issues/944#issuecomment-691788478 https://api.github.com/repos/simonw/datasette/issues/944 MDEyOklzc3VlQ29tbWVudDY5MTc4ODQ3OA== simonw 9599 2020-09-14T03:21:45Z 2020-09-14T03:21:45Z OWNER

Having tried this out I think it does need a raise_404() mechanism - which needs to be smart enough to trigger the default 404 handler without accidentally going into an infinite loop.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Path parameters for custom pages 681516976  
691774262 https://github.com/simonw/datasette/issues/944#issuecomment-691774262 https://api.github.com/repos/simonw/datasette/issues/944 MDEyOklzc3VlQ29tbWVudDY5MTc3NDI2Mg== simonw 9599 2020-09-14T02:24:08Z 2020-09-14T02:24:08Z OWNER

Actually don't need {{ raise_404("Museum not found") }} because we already have {{ custom_status(404) }}.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Path parameters for custom pages 681516976  
691769222 https://github.com/simonw/datasette/issues/944#issuecomment-691769222 https://api.github.com/repos/simonw/datasette/issues/944 MDEyOklzc3VlQ29tbWVudDY5MTc2OTIyMg== simonw 9599 2020-09-14T02:01:33Z 2020-09-14T02:01:33Z OWNER

I'm going to cache the list_templates() result in memory. If you want to add a new template-defined route you will need to restart the server. I think that's acceptable.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Path parameters for custom pages 681516976  
675830678 https://github.com/simonw/datasette/issues/944#issuecomment-675830678 https://api.github.com/repos/simonw/datasette/issues/944 MDEyOklzc3VlQ29tbWVudDY3NTgzMDY3OA== simonw 9599 2020-08-19T03:30:10Z 2020-08-19T03:30:10Z OWNER

These templates will need a way to raise a 404 - so that if the template itself is deciding if the page exists (for example using datasette-template-sql or the proposed datasette.get() method from #943 or the graphql() template function in https://github.com/simonw/datasette-graphql/issues/50) it can return a regular 404 page.

This can imitate the custom_redirect() function from https://docs.datasette.io/en/stable/custom_templates.html#custom-redirects: html+jinja {{ custom_redirect("https://github.com/simonw/datasette", 301) }} It could be as simple as this: {{ raise_404("Museum not found") }}

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Path parameters for custom pages 681516976  
675829942 https://github.com/simonw/datasette/issues/944#issuecomment-675829942 https://api.github.com/repos/simonw/datasette/issues/944 MDEyOklzc3VlQ29tbWVudDY3NTgyOTk0Mg== simonw 9599 2020-08-19T03:27:25Z 2020-08-19T03:27:25Z OWNER

I created a template file called templates/pages/museums/{slug}.html and used the debugger to see if Jinja could see it. This worked: (Pdb) self.ds.jinja_env.list_templates() ['500.html', '_codemirror.html', '_codemirror_foot.html', '_description_source_license.html', '_footer.html', '_table.html', 'allow_debug.html', 'base.html', 'database.html', 'default:500.html', 'default:_codemirror.html', 'default:_codemirror_foot.html', 'default:_description_source_license.html', 'default:_footer.html', 'default:_table.html', 'default:allow_debug.html', 'default:base.html', 'default:database.html', 'default:index.html', 'default:logout.html', 'default:messages_debug.html', 'default:patterns.html', 'default:permissions_debug.html', 'default:query.html', 'default:row.html', 'default:show_json.html', 'default:table.html', 'forbidden.html', 'index.html', 'logout.html', 'messages_debug.html', 'pages/about.html', 'pages/museums/{slug}.html', 'patterns.html', 'permissions_debug.html', 'query.html', 'row.html', 'show_json.html', 'table.html'] The pages/museums/{slug}.html template is in that list.

Here's the implementation of that list_templates() method - it does some filesystem walking so it may be a bit expensive to run it on every request: https://github.com/pallets/jinja/blob/ca8b0b0287e320fe1f4a74f36910ef7ae3303d99/src/jinja2/loaders.py#L197-L212

But caching it would be pretty easy - either until the server is restarted or as an in-memory cache for a few seconds.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Path parameters for custom pages 681516976  

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