home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

6 rows where issue = 1223699280 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 6

issue 1

  • .db downloads should be served with an ETag · 6 ✖

author_association 1

  • OWNER 6
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
1117662420 https://github.com/simonw/datasette/issues/1739#issuecomment-1117662420 https://api.github.com/repos/simonw/datasette/issues/1739 IC_kwDOBm6k_c5CnizU simonw 9599 2022-05-04T18:21:18Z 2022-05-04T18:21:18Z OWNER

That prototype is now public: https://github.com/simonw/datasette-lite

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
.db downloads should be served with an ETag 1223699280  
1116215371 https://github.com/simonw/datasette/issues/1739#issuecomment-1116215371 https://api.github.com/repos/simonw/datasette/issues/1739 IC_kwDOBm6k_c5CiBhL simonw 9599 2022-05-03T15:12:16Z 2022-05-03T15:12:16Z OWNER

That worked - both DBs are 304 for me now on a subsequent load of the page:

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
.db downloads should be served with an ETag 1223699280  
1116183369 https://github.com/simonw/datasette/issues/1739#issuecomment-1116183369 https://api.github.com/repos/simonw/datasette/issues/1739 IC_kwDOBm6k_c5Ch5tJ simonw 9599 2022-05-03T14:43:14Z 2022-05-03T14:43:14Z OWNER

Relevant tests start here: https://github.com/simonw/datasette/blob/d60f163528f466b1127b2935c3b6869c34fd6545/tests/test_html.py#L395

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
.db downloads should be served with an ETag 1223699280  
1116180599 https://github.com/simonw/datasette/issues/1739#issuecomment-1116180599 https://api.github.com/repos/simonw/datasette/issues/1739 IC_kwDOBm6k_c5Ch5B3 simonw 9599 2022-05-03T14:40:32Z 2022-05-03T14:40:32Z OWNER

Database downloads are served here: https://github.com/simonw/datasette/blob/d60f163528f466b1127b2935c3b6869c34fd6545/datasette/views/database.py#L186-L192

Here's AsgiFileDownload: https://github.com/simonw/datasette/blob/d60f163528f466b1127b2935c3b6869c34fd6545/datasette/utils/asgi.py#L410-L430

I can add an etag= parameter to that and populate it with db.hash, if it is populated (which it always should be for immutable databases that can be downloaded).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
.db downloads should be served with an ETag 1223699280  
1116178727 https://github.com/simonw/datasette/issues/1739#issuecomment-1116178727 https://api.github.com/repos/simonw/datasette/issues/1739 IC_kwDOBm6k_c5Ch4kn simonw 9599 2022-05-03T14:38:46Z 2022-05-03T14:38:46Z OWNER

Reminded myself how this works by reviewing conditional-get: https://github.com/simonw/conditional-get/blob/db6dfec0a296080aaf68fcd80e55fb3f0714e738/conditional_get/cli.py#L33-L52

Simply add a If-None-Match: last-known-etag header to the request and check that the response is a status 304 with an empty body.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
.db downloads should be served with an ETag 1223699280  
1115760104 https://github.com/simonw/datasette/issues/1739#issuecomment-1115760104 https://api.github.com/repos/simonw/datasette/issues/1739 IC_kwDOBm6k_c5CgSXo simonw 9599 2022-05-03T05:50:19Z 2022-05-03T05:50:19Z OWNER

Here's how Starlette does it: https://github.com/encode/starlette/blob/830f3486537916bae6b46948ff922adc14a22b7c/starlette/staticfiles.py#L213

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
.db downloads should be served with an ETag 1223699280  

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