home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

5 rows where issue = 1430797211 and "updated_at" is on date 2022-11-14 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

  • Figure out design for JSON errors (consider RFC 7807) · 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
1314545407 https://github.com/simonw/datasette/issues/1875#issuecomment-1314545407 https://api.github.com/repos/simonw/datasette/issues/1875 IC_kwDOBm6k_c5OWl7_ simonw 9599 2022-11-14T23:30:34Z 2022-11-14T23:30:34Z OWNER

TIL: https://til.simonwillison.net/json/json-pointer

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Figure out design for JSON errors (consider RFC 7807) 1430797211  
1314491884 https://github.com/simonw/datasette/issues/1875#issuecomment-1314491884 https://api.github.com/repos/simonw/datasette/issues/1875 IC_kwDOBm6k_c5OWY3s simonw 9599 2022-11-14T22:26:11Z 2022-11-14T22:26:54Z OWNER

Spec looks pretty simple:

A JSON Pointer is a Unicode string (see [RFC4627], Section 3) containing a sequence of zero or more reference tokens, each prefixed by a / (%x2F) character.

Because the characters ~ (%x7E) and / (%x2F) have special meanings in JSON Pointer, ~ needs to be encoded as ~0 and / needs to be encoded as ~1 when these characters appear in a reference token.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Figure out design for JSON errors (consider RFC 7807) 1430797211  
1314491150 https://github.com/simonw/datasette/issues/1875#issuecomment-1314491150 https://api.github.com/repos/simonw/datasette/issues/1875 IC_kwDOBm6k_c5OWYsO simonw 9599 2022-11-14T22:25:20Z 2022-11-14T22:25:20Z OWNER

That's using JSON Pointer: https://www.rfc-editor.org/rfc/rfc6901

There's a Python library for that here https://github.com/stefankoegl/python-json-pointer/blob/master/jsonpointer.py - which looks simple and clean and well maintained and documented, but it only handles the "what is at this pointer within this JSON object" case - I need to generate the correct JSON pointer to explain where my error is.

So I think I'll end up hand-rolling this.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Figure out design for JSON errors (consider RFC 7807) 1430797211  
1314488010 https://github.com/simonw/datasette/issues/1875#issuecomment-1314488010 https://api.github.com/repos/simonw/datasette/issues/1875 IC_kwDOBm6k_c5OWX7K simonw 9599 2022-11-14T22:21:43Z 2022-11-14T22:21:43Z OWNER

Here's the most relevant example from the RFC spec: POST /details HTTP/1.1 Host: account.example.com Accept: application/json json { "age": 42.3, "profile": { "color": "yellow" } } HTTP/1.1 400 Bad Request Content-Type: application/problem+json Content-Language: en json { "type": "https://example.net/validation-error", "title": "Your request is not valid.", "errors": [ { "detail": "must be a positive integer", "pointer": "#/age" }, { "detail": "must be 'green', 'red' or 'blue'", "pointer": "#/profile/color" } ] }

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Figure out design for JSON errors (consider RFC 7807) 1430797211  
1313114283 https://github.com/simonw/datasette/issues/1875#issuecomment-1313114283 https://api.github.com/repos/simonw/datasette/issues/1875 IC_kwDOBm6k_c5ORIir simonw 9599 2022-11-14T05:20:00Z 2022-11-14T05:20:00Z OWNER

I started a conversation about JSON error standards on Mastodon here: https://fedi.simonwillison.net/web/@simon/109338725610487457

Quite a few people pointed to this RFC independently.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Figure out design for JSON errors (consider RFC 7807) 1430797211  

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