home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

21 rows where author_association = "OWNER" 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: issue_url, reactions, created_at (date), updated_at (date)

issue 9

  • Figure out design for JSON errors (consider RFC 7807) 5
  • API explorer tool 4
  • Write API in Datasette core 3
  • API to drop a table 3
  • Add a confirm step to the drop table API 2
  • API for bulk inserting records into a table 1
  • Exclude virtual tables from datasette inspect 1
  • Call for birthday presents: if you're using Datasette, let us know how you're using it here 1
  • API explorer should take immutability into account 1

user 1

  • simonw 21

author_association 1

  • OWNER · 21 ✖
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  
1314054300 https://github.com/simonw/datasette/issues/1884#issuecomment-1314054300 https://api.github.com/repos/simonw/datasette/issues/1884 IC_kwDOBm6k_c5OUuCc simonw 9599 2022-11-14T16:40:06Z 2022-11-14T16:40:06Z OWNER

I wonder if there are any reasons that inspect SHOULD try to count virtual tables? Like are there any likely uses for a cirial table where the count is both interesting and likely to be accessed often enough that it's worth caching?

I have an issue open to add a setting to disable table counts entirely:

  • 1818

Maybe that should be expanded to automatically disable row counts for virtual tables entirely? Which would mean no count would be shown for them in the UI.

If you desperately wanted a count you would then have to run a count(*) query against them explicitly.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Exclude virtual tables from datasette inspect 1439009231  
1313156167 https://github.com/simonw/datasette/issues/1850#issuecomment-1313156167 https://api.github.com/repos/simonw/datasette/issues/1850 IC_kwDOBm6k_c5ORSxH simonw 9599 2022-11-14T06:23:39Z 2022-11-14T06:23:39Z OWNER

The API explorer is now live here: https://latest-1-0-dev.datasette.io/-/api

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Write API in Datasette core 1421529723  
1313155712 https://github.com/simonw/datasette/issues/1850#issuecomment-1313155712 https://api.github.com/repos/simonw/datasette/issues/1850 IC_kwDOBm6k_c5ORSqA simonw 9599 2022-11-14T06:22:57Z 2022-11-14T06:22:57Z OWNER

I think the ability to create tokens should be protected by a create-tokens permission, not just a global setting.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Write API in Datasette core 1421529723  
1313139657 https://github.com/simonw/datasette/issues/1888#issuecomment-1313139657 https://api.github.com/repos/simonw/datasette/issues/1888 IC_kwDOBm6k_c5OROvJ simonw 9599 2022-11-14T06:04:48Z 2022-11-14T06:04:48Z OWNER

Demo: https://latest-1-0-dev.datasette.io/-/api

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
API explorer should take immutability into account 1447439985  
1313128913 https://github.com/simonw/datasette/issues/1866#issuecomment-1313128913 https://api.github.com/repos/simonw/datasette/issues/1866 IC_kwDOBm6k_c5ORMHR simonw 9599 2022-11-14T05:48:22Z 2022-11-14T05:48:22Z OWNER

I changed my mind about the "return_rows": true option - I'm going to rename it to "return": true.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
API for bulk inserting records into a table 1426001541  
1313127054 https://github.com/simonw/datasette/issues/1874#issuecomment-1313127054 https://api.github.com/repos/simonw/datasette/issues/1874 IC_kwDOBm6k_c5ORLqO simonw 9599 2022-11-14T05:45:00Z 2022-11-14T05:45:00Z OWNER

Demo: https://latest-1-0-dev.datasette.io/-/api#path=%2Ffixtures%2Ffacetable%2F-%2Fdrop&json=&method=POST

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
API to drop a table 1429030341  
1313125870 https://github.com/simonw/datasette/issues/1871#issuecomment-1313125870 https://api.github.com/repos/simonw/datasette/issues/1871 IC_kwDOBm6k_c5ORLXu simonw 9599 2022-11-14T05:42:50Z 2022-11-14T05:42:50Z OWNER

Demo: https://latest-1-0-dev.datasette.io/-/api#path=%2Ffixtures%2Ffacetable%2F-%2Fdrop&json=%7B%22confirm%22%3A+true%7D&method=POST

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
API explorer tool 1427293909  
1313125123 https://github.com/simonw/datasette/issues/1874#issuecomment-1313125123 https://api.github.com/repos/simonw/datasette/issues/1874 IC_kwDOBm6k_c5ORLMD simonw 9599 2022-11-14T05:41:20Z 2022-11-14T05:42:23Z OWNER

I also changed the confirmation JSON returned by this endpoint to add the database and table like so: json { "ok": true, "database": "data", "table": "docs", "row_count": 1, "message": "Pass \"confirm\": true to confirm" } Updated docs: https://docs.datasette.io/en/1.0-dev/json_api.html#dropping-tables

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
API to drop a table 1429030341  
1313119558 https://github.com/simonw/datasette/issues/1874#issuecomment-1313119558 https://api.github.com/repos/simonw/datasette/issues/1874 IC_kwDOBm6k_c5ORJ1G simonw 9599 2022-11-14T05:30:27Z 2022-11-14T05:30:27Z OWNER

Found a bug: you get a 500 error if you try this against an immutable database.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
API to drop a table 1429030341  
1313115059 https://github.com/simonw/datasette/issues/1850#issuecomment-1313115059 https://api.github.com/repos/simonw/datasette/issues/1850 IC_kwDOBm6k_c5ORIuz simonw 9599 2022-11-14T05:21:30Z 2022-11-14T05:21:30Z OWNER

New documentation for these features currently lives here: https://docs.datasette.io/en/1.0-dev/json_api.html#the-json-write-api

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Write API in Datasette core 1421529723  
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  
1313113642 https://github.com/simonw/datasette/issues/1887#issuecomment-1313113642 https://api.github.com/repos/simonw/datasette/issues/1887 IC_kwDOBm6k_c5ORIYq simonw 9599 2022-11-14T05:18:51Z 2022-11-14T05:18:51Z OWNER

Updated docs: https://docs.datasette.io/en/1.0-dev/json_api.html#dropping-tables

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Add a confirm step to the drop table API 1447388809  
1313097713 https://github.com/simonw/datasette/issues/1887#issuecomment-1313097713 https://api.github.com/repos/simonw/datasette/issues/1887 IC_kwDOBm6k_c5OREfx simonw 9599 2022-11-14T05:00:54Z 2022-11-14T05:00:54Z OWNER

I'm going to add a "confirm": true option to the API. Without that, it returns a note about how many rows will be deleted.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Add a confirm step to the drop table API 1447388809  
1313097057 https://github.com/simonw/datasette/issues/1871#issuecomment-1313097057 https://api.github.com/repos/simonw/datasette/issues/1871 IC_kwDOBm6k_c5OREVh simonw 9599 2022-11-14T04:59:28Z 2022-11-14T04:59:28Z OWNER

In playing with the API explorer just now I realized it's way too easy to accidentally drop a table using it.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
API explorer tool 1427293909  
1313072900 https://github.com/simonw/datasette/issues/1871#issuecomment-1313072900 https://api.github.com/repos/simonw/datasette/issues/1871 IC_kwDOBm6k_c5OQ-cE simonw 9599 2022-11-14T04:15:50Z 2022-11-14T04:15:50Z OWNER

For the example links - I'm going to have these at the bottom of the page so you don't have to scroll past them.

Ideally these would take the user's permissions into account. This could make the page expensive to load, but I'm going to risk it for the moment.

Something like this then:

  • data
  • /data/-/create - create table
  • /data/table1/-/insert - insert into table1
  • /data/table1/-/drop - drop table1

I won't bother with per-row demo links (for update and delete) because there could be thousands of them for each table.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
API explorer tool 1427293909  
1313062699 https://github.com/simonw/datasette/issues/1871#issuecomment-1313062699 https://api.github.com/repos/simonw/datasette/issues/1871 IC_kwDOBm6k_c5OQ78r simonw 9599 2022-11-14T04:03:29Z 2022-11-14T04:12:41Z OWNER

Two things left before I close this issue:

  • [x] I want to preserve the state of the forms in the URL - probably after a #
  • [ ] Instead of hard-coding the current examples, I want to provide a list of links which populate the forms
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
API explorer tool 1427293909  
1313052863 https://github.com/simonw/datasette/issues/1886#issuecomment-1313052863 https://api.github.com/repos/simonw/datasette/issues/1886 IC_kwDOBm6k_c5OQ5i_ simonw 9599 2022-11-14T03:40:50Z 2022-11-14T03:40:50Z OWNER

Tim Sherratt on Twitter: https://twitter.com/wragge/status/1591930345469153282

Where do I start? The #GLAMWorkbench now includes a number of examples where GLAM data is harvested, processed, and then made available for exploration via Datasette.

https://glam-workbench.net/

For example the GLAM Name Index Search brings together 10+ million entries from 240 indexes and provides an aggregated search using the Datasette search-all plugin:

https://glam-workbench.net/name-search/

Most recently I converted PDFs of the Tasmanian Postal Directories to a big Datasette instance: https://updates.timsherratt.org/2022/09/15/from-pdfs-to.html the process is documented and reusable.

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 1,
    "rocket": 0,
    "eyes": 0
}
Call for birthday presents: if you're using Datasette, let us know how you're using it here 1447050738  

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