issue_comments
20 rows where issue = 627794879 and "updated_at" is on date 2021-02-20 sorted by reactions
This data as json, CSV (advanced)
Suggested facets: reactions, created_at (date)
id | html_url | issue_url | node_id | user | created_at | updated_at | author_association | body | reactions ▼ | issue | performed_via_github_app |
---|---|---|---|---|---|---|---|---|---|---|---|
782708938 | https://github.com/simonw/datasette/issues/782#issuecomment-782708938 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDc4MjcwODkzOA== | simonw 9599 | 2021-02-20T16:22:14Z | 2021-02-20T16:22:14Z | OWNER | I'm leaning back in the direction of a flat JSON array of objects as the default - this:
Would return:
Opting in to the But... having to add |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
782709270 | https://github.com/simonw/datasette/issues/782#issuecomment-782709270 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDc4MjcwOTI3MA== | simonw 9599 | 2021-02-20T16:23:51Z | 2021-02-20T16:24:11Z | OWNER | Also how would you opt out of returning the Some options:
I quite like that last one with |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
782709425 | https://github.com/simonw/datasette/issues/782#issuecomment-782709425 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDc4MjcwOTQyNQ== | simonw 9599 | 2021-02-20T16:24:54Z | 2021-02-20T16:24:54Z | OWNER | Having shortcuts means I could support |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
782739926 | https://github.com/simonw/datasette/issues/782#issuecomment-782739926 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDc4MjczOTkyNg== | simonw 9599 | 2021-02-20T19:51:30Z | 2021-02-20T19:52:19Z | OWNER | Demos:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
782740488 | https://github.com/simonw/datasette/issues/782#issuecomment-782740488 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDc4Mjc0MDQ4OA== | simonw 9599 | 2021-02-20T19:55:23Z | 2021-02-20T19:55:23Z | OWNER | Am I saying you won't get back a key in the response unless you explicitly request it, either by name or by specifying a bundle of extras (e.g. The Also: having bundles like Maybe bundles could be prefixed with something, perhaps an underscore? |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
782740604 | https://github.com/simonw/datasette/issues/782#issuecomment-782740604 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDc4Mjc0MDYwNA== | simonw 9599 | 2021-02-20T19:56:21Z | 2021-02-20T19:56:33Z | OWNER | I think I want to support |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
782740985 | https://github.com/simonw/datasette/issues/782#issuecomment-782740985 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDc4Mjc0MDk4NQ== | simonw 9599 | 2021-02-20T19:59:21Z | 2021-02-20T19:59:21Z | OWNER | This design should be influenced by how it's implemented. One implementation that could be nice is that each of the keys that can be requested - This raises more questions: Both I think I need to flesh out the full default collection of |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
782741107 | https://github.com/simonw/datasette/issues/782#issuecomment-782741107 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDc4Mjc0MTEwNw== | simonw 9599 | 2021-02-20T20:00:22Z | 2021-02-20T20:00:22Z | OWNER | A really exciting opportunity this opens up is for parallel execution - the |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
782741719 | https://github.com/simonw/datasette/issues/782#issuecomment-782741719 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDc4Mjc0MTcxOQ== | simonw 9599 | 2021-02-20T20:05:04Z | 2021-02-20T20:05:04Z | OWNER |
This is something I've not thought very hard about. If there's an error, I need to return a top-level object, not a top-level array, so I can provide details of the error. But this means that client code will have to handle this difference - it will have to know that the returned data can be array-shaped if nothing went wrong, and object-shaped if there's an error. The HTTP status code helps here - calling client code can know that a 200 status code means there will be an array, but an error status code means an object. If developers really hate that the shape could be different, they can always use |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
782742233 | https://github.com/simonw/datasette/issues/782#issuecomment-782742233 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDc4Mjc0MjIzMw== | simonw 9599 | 2021-02-20T20:09:16Z | 2021-02-20T20:09:16Z | OWNER | I just noticed that https://latest-with-plugins.datasette.io/github/commits.json-preview?_extra=total&_size=0&_trace=1 executes 35 SQL queries at the moment! A great reminder that a big improvement from this change will be a reduction in queries through not calculating things like suggested facets unless they are explicitly requested. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
782746633 | https://github.com/simonw/datasette/issues/782#issuecomment-782746633 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDc4Mjc0NjYzMw== | simonw 9599 | 2021-02-20T20:43:07Z | 2021-02-20T20:43:07Z | OWNER | Another option:
I had something similar to this in Datasette a few years ago - a |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
782746755 | https://github.com/simonw/datasette/issues/782#issuecomment-782746755 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDc4Mjc0Njc1NQ== | frankieroberto 30665 | 2021-02-20T20:44:05Z | 2021-02-20T20:44:05Z | NONE | Minor suggestion: rename I like the idea of specifying a limit of 0 if you don’t want any rows data - and returning an empty array under the Have you given any thought as to whether to pretty print (format with spaces) the output or not? Can be useful for debugging/exploring in a browser or other basic tools which don’t parse the JSON. Could be default (can’t be much bigger with gzip?) or opt-in. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
782747164 | https://github.com/simonw/datasette/issues/782#issuecomment-782747164 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDc4Mjc0NzE2NA== | simonw 9599 | 2021-02-20T20:47:16Z | 2021-02-20T20:47:16Z | OWNER | (I started a thread on Twitter about this: https://twitter.com/simonw/status/1363220355318358016) |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
782747743 | https://github.com/simonw/datasette/issues/782#issuecomment-782747743 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDc4Mjc0Nzc0Mw== | simonw 9599 | 2021-02-20T20:52:10Z | 2021-02-20T20:52:10Z | OWNER |
The problem there is that https://latest-with-plugins.datasette.io/github?sql=select+*+from+commits - Datasette returns 1,000 results, and shows a "Custom SQL query returning more than 1,000 rows" message at the top. That's the I find myself using This is only really a concern for arbitrary SQL queries though - for table pages such as https://latest-with-plugins.datasette.io/github/commits?_size=10 adding |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
782747878 | https://github.com/simonw/datasette/issues/782#issuecomment-782747878 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDc4Mjc0Nzg3OA== | simonw 9599 | 2021-02-20T20:53:11Z | 2021-02-20T20:53:11Z | OWNER | ... though thinking about this further, I could re-implement the |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
782748093 | https://github.com/simonw/datasette/issues/782#issuecomment-782748093 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDc4Mjc0ODA5Mw== | simonw 9599 | 2021-02-20T20:54:52Z | 2021-02-20T20:54:52Z | OWNER |
Adding a |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
782748501 | https://github.com/simonw/datasette/issues/782#issuecomment-782748501 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDc4Mjc0ODUwMQ== | simonw 9599 | 2021-02-20T20:58:18Z | 2021-02-20T20:58:18Z | OWNER | Yet another option: support a
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
782756398 | https://github.com/simonw/datasette/issues/782#issuecomment-782756398 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDc4Mjc1NjM5OA== | simonrjones 601316 | 2021-02-20T22:05:48Z | 2021-02-20T22:05:48Z | NONE |
I agree it is more predictable if the top level item is an object with a rows or data object that contains an array of data, which then allows for other top-level meta data. I can see the argument for removing this and just using an array for convenience - but I think that's OK as an option (as you have now). Rather than have lots of top-level keys you could have a "meta" object to contain non-data stuff. You could use something like "links" for API endpoint URLs (or use a standard like HAL). Which would then leave the top level a bit cleaner - if that's what you what. Have you had much feedback from users who use the Datasette API a lot? |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
782745199 | https://github.com/simonw/datasette/issues/782#issuecomment-782745199 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDc4Mjc0NTE5OQ== | frankieroberto 30665 | 2021-02-20T20:32:03Z | 2021-02-20T20:32:03Z | NONE | I think it’s a good idea if the top level item of the response JSON is always an object, rather than an array, at least as the default. Mainly because it allows you to add extra keys in a backwards-compatible way. Also just seems more expected somehow. The API design guidance for the UK government also recommends this: https://www.gov.uk/guidance/gds-api-technical-and-data-standards#use-json I also strongly dislike having versioned APIs (eg with a |
{ "total_count": 1, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 1 } |
Redesign default .json format 627794879 | |
782765665 | https://github.com/simonw/datasette/issues/782#issuecomment-782765665 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDc4Mjc2NTY2NQ== | simonw 9599 | 2021-02-20T23:34:41Z | 2021-02-20T23:34:41Z | OWNER | OK, I'm back to the "top level object as the default" side of things now - it's pretty much unanimous at this point, and it's certainly true that it's not a decision you'll even regret. |
{ "total_count": 2, "+1": 2, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 |
Advanced export
JSON shape: default, array, newline-delimited, object
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]);
user 3