issue_comments
50 rows where author_association = "OWNER", issue = 627794879 and user = 9599 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: reactions, created_at (date), updated_at (date)
issue 1
- Redesign default .json format · 50 ✖
id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | issue | performed_via_github_app |
---|---|---|---|---|---|---|---|---|---|---|---|
1672340556 | https://github.com/simonw/datasette/issues/782#issuecomment-1672340556 | https://api.github.com/repos/simonw/datasette/issues/782 | IC_kwDOBm6k_c5jreRM | simonw 9599 | 2023-08-10T00:07:17Z | 2023-08-10T00:07:17Z | OWNER | Most of this is shipped in https://docs.datasette.io/en/1.0a3/changelog.html#a3-2023-08-09 |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
1368269732 | https://github.com/simonw/datasette/issues/782#issuecomment-1368269732 | https://api.github.com/repos/simonw/datasette/issues/782 | IC_kwDOBm6k_c5RjiOk | simonw 9599 | 2022-12-31T19:32:33Z | 2023-01-17T02:05:45Z | OWNER | New thinking on the trimmed-down default. Previously I was going to use This is even more succinct. I'm OK with people having to request 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 | |
1368285442 | https://github.com/simonw/datasette/issues/782#issuecomment-1368285442 | https://api.github.com/repos/simonw/datasette/issues/782 | IC_kwDOBm6k_c5RjmEC | simonw 9599 | 2022-12-31T22:02:16Z | 2022-12-31T22:02:16Z | OWNER | https://latest.datasette.io/fixtures/compound_three_primary_keys.json?_size=2 now returns
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
1368278278 | https://github.com/simonw/datasette/issues/782#issuecomment-1368278278 | https://api.github.com/repos/simonw/datasette/issues/782 | IC_kwDOBm6k_c5RjkUG | simonw 9599 | 2022-12-31T20:49:38Z | 2022-12-31T20:49:38Z | OWNER | I'm going to rename |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
1368269811 | https://github.com/simonw/datasette/issues/782#issuecomment-1368269811 | https://api.github.com/repos/simonw/datasette/issues/782 | IC_kwDOBm6k_c5RjiPz | simonw 9599 | 2022-12-31T19:33:09Z | 2022-12-31T19:33:09Z | OWNER | Here's the so-far updated documentation for this change: https://github.com/simonw/datasette/blob/a2dca62360ad4a961d4c46f68eae41b7d5c7b2c9/docs/json_api.rst#different-shapes |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
1368269283 | https://github.com/simonw/datasette/issues/782#issuecomment-1368269283 | https://api.github.com/repos/simonw/datasette/issues/782 | IC_kwDOBm6k_c5RjiHj | simonw 9599 | 2022-12-31T19:29:45Z | 2022-12-31T19:29:45Z | OWNER | https://latest.datasette.io/fixtures/compound_three_primary_keys.json?_size=2 now shows the new default:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
1368268148 | https://github.com/simonw/datasette/issues/782#issuecomment-1368268148 | https://api.github.com/repos/simonw/datasette/issues/782 | IC_kwDOBm6k_c5Rjh10 | simonw 9599 | 2022-12-31T19:22:07Z | 2022-12-31T19:22:07Z | OWNER | It turned out the most significant part of this change - switching from an array of arrays to an array of objects for 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 | |
970554697 | https://github.com/simonw/datasette/issues/782#issuecomment-970554697 | https://api.github.com/repos/simonw/datasette/issues/782 | IC_kwDOBm6k_c452X1J | simonw 9599 | 2021-11-16T18:32:03Z | 2021-11-16T18:32:03Z | OWNER | I'm going to take another look at this: - https://github.com/simonw/datasette/issues/878 |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
970553780 | https://github.com/simonw/datasette/issues/782#issuecomment-970553780 | https://api.github.com/repos/simonw/datasette/issues/782 | IC_kwDOBm6k_c452Xm0 | simonw 9599 | 2021-11-16T18:30:51Z | 2021-11-16T18:30:58Z | OWNER | OK, I'm ready to start working on this today. I'm going to go with a default representation that looks like this:
I'll implement |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
803469623 | https://github.com/simonw/datasette/issues/782#issuecomment-803469623 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDgwMzQ2OTYyMw== | simonw 9599 | 2021-03-20T22:01:23Z | 2021-03-20T22:01:23Z | OWNER | I'm going to keep |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
782789598 | https://github.com/simonw/datasette/issues/782#issuecomment-782789598 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDc4Mjc4OTU5OA== | simonw 9599 | 2021-02-21T03:30:02Z | 2021-02-21T03:30:02Z | OWNER | Another benefit to default:object - I could include a key that shows a list of available extras. I could then use that to power an interactive API explorer. |
{ "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
755484384 | https://github.com/simonw/datasette/issues/782#issuecomment-755484384 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDc1NTQ4NDM4NA== | simonw 9599 | 2021-01-06T18:31:14Z | 2021-01-06T18:31:57Z | OWNER | In building https://latest-with-plugins.datasette.io/github/issue_comments.Notebook?_labels=on I discovered the following patterns for importing data into both Pandas and Observable/d3:
Even given this I still think the correct default is an object 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 | |
754958610 | https://github.com/simonw/datasette/issues/782#issuecomment-754958610 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDc1NDk1ODYxMA== | simonw 9599 | 2021-01-05T23:15:24Z | 2021-01-05T23:15:24Z | OWNER | https://latest-with-plugins.datasette.io/fixtures/roadside_attraction_characteristics/1.json-preview returns a 500 error at the moment - a KeyError on 'filtered_table_rows_count'. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
720028476 | https://github.com/simonw/datasette/issues/782#issuecomment-720028476 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDcyMDAyODQ3Ng== | simonw 9599 | 2020-11-01T05:00:05Z | 2020-11-01T05:00:05Z | OWNER | This should be the key focus for Datasette 0.52. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
712986115 | https://github.com/simonw/datasette/issues/782#issuecomment-712986115 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDcxMjk4NjExNQ== | simonw 9599 | 2020-10-20T16:28:46Z | 2020-10-20T16:29:51Z | OWNER | I think this all comes down to how the Extras need to be able to execute additional SQL, since that would solve the problem we have now where the expensive "suggested facets" code runs on all |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
712590398 | https://github.com/simonw/datasette/issues/782#issuecomment-712590398 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDcxMjU5MDM5OA== | simonw 9599 | 2020-10-20T05:03:46Z | 2020-10-20T05:04:09Z | OWNER | OK, https://latest-with-plugins.datasette.io/ is running that now - e.g. https://latest-with-plugins.datasette.io/fixtures/roadside_attractions.json-preview or https://latest-with-plugins.datasette.io/fixtures/compound_three_primary_keys.json-preview
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
712585921 | https://github.com/simonw/datasette/issues/782#issuecomment-712585921 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDcxMjU4NTkyMQ== | simonw 9599 | 2020-10-20T04:48:01Z | 2020-10-20T04:48:01Z | OWNER | I'll update |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
712585687 | https://github.com/simonw/datasette/issues/782#issuecomment-712585687 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDcxMjU4NTY4Nw== | simonw 9599 | 2020-10-20T04:47:02Z | 2020-10-20T04:47:12Z | OWNER | Great point about CORS, I hadn't considered that. I think I'm going to keep the
So three keys: |
{ "total_count": 3, "+1": 3, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
706745236 | https://github.com/simonw/datasette/issues/782#issuecomment-706745236 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDcwNjc0NTIzNg== | simonw 9599 | 2020-10-11T18:16:05Z | 2020-10-11T18:16:05Z | OWNER | Here's 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 | |
706740250 | https://github.com/simonw/datasette/issues/782#issuecomment-706740250 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDcwNjc0MDI1MA== | simonw 9599 | 2020-10-11T17:40:48Z | 2020-10-11T17:43:07Z | OWNER | Building this plugin reminded me of an oddity of the That's not ideal. I'd like custom renderers to be able to access this data to get at things like suggested facets, on an opt-in basis. So maybe that kind of stuff is re-implemented as "extras" which are awaitable callables - then renderer plugins can call the extras that they need to as part of their execution. To illustrate the problem (in this case the need to access @hookimpl def register_output_renderer(datasette): return { "extension": "json-preview", "render": json_preview, } def json_preview(data, columns, rows): next_url = data.get("next_url") headers = {} if next_url: headers["link"] = '<{}>; rel="next"'.format(next_url) return Response.json([dict(zip(columns, row)) for row in rows], headers=headers) ``` |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
706738020 | https://github.com/simonw/datasette/issues/782#issuecomment-706738020 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDcwNjczODAyMA== | simonw 9599 | 2020-10-11T17:23:18Z | 2020-10-11T17:23:48Z | OWNER | I'm going to prototype what it would look like if the default shape was a list of objects and |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
706735341 | https://github.com/simonw/datasette/issues/782#issuecomment-706735341 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDcwNjczNTM0MQ== | simonw 9599 | 2020-10-11T17:03:29Z | 2020-10-11T17:15:34Z | OWNER | Maybe Or... |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
706735200 | https://github.com/simonw/datasette/issues/782#issuecomment-706735200 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDcwNjczNTIwMA== | simonw 9599 | 2020-10-11T17:02:11Z | 2020-10-11T17:14:51Z | OWNER | Since the total count can be expensive to calculate, I'm inclined to make that an opt-in extra - maybe Based on that, the default JSON shape could look something like this:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
706736541 | https://github.com/simonw/datasette/issues/782#issuecomment-706736541 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDcwNjczNjU0MQ== | simonw 9599 | 2020-10-11T17:12:27Z | 2020-10-11T17:12:27Z | OWNER | The core issue that I keep reconsidering is whether the default Arguments in favour of a list:
Arguments against:
But maybe that last point is a positive? It ensures the default If Maybe
The thing I care about most though is
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
706735280 | https://github.com/simonw/datasette/issues/782#issuecomment-706735280 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDcwNjczNTI4MA== | simonw 9599 | 2020-10-11T17:03:01Z | 2020-10-11T17:03:01Z | OWNER | Should that default also include |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
691554088 | https://github.com/simonw/datasette/issues/782#issuecomment-691554088 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDY5MTU1NDA4OA== | simonw 9599 | 2020-09-12T21:39:03Z | 2020-09-12T21:39:03Z | OWNER | Plan: release a new release of Datasette (probably 0.49) with the new JSON API design, but provide a plugin called something like Anyone who has built applications against 0.48 can install that plugin. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
691526878 | https://github.com/simonw/datasette/issues/782#issuecomment-691526878 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDY5MTUyNjg3OA== | simonw 9599 | 2020-09-12T18:21:41Z | 2020-09-12T18:22:20Z | OWNER | Would it be so bad if the default format had a A default format that's an object rather than array also gives something for 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 | |
691526762 | https://github.com/simonw/datasette/issues/782#issuecomment-691526762 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDY5MTUyNjc2Mg== | simonw 9599 | 2020-09-12T18:20:19Z | 2020-09-12T18:20:19Z | OWNER | I'd like to revisit the idea of using |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
691526489 | https://github.com/simonw/datasette/issues/782#issuecomment-691526489 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDY5MTUyNjQ4OQ== | simonw 9599 | 2020-09-12T18:17:16Z | 2020-09-12T18:17:16Z | OWNER | (I think I may have been over-thinking the details of this is for a couple of years now.) |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
691526416 | https://github.com/simonw/datasette/issues/782#issuecomment-691526416 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDY5MTUyNjQxNg== | simonw 9599 | 2020-09-12T18:16:36Z | 2020-09-12T18:16:36Z | OWNER | I'm going to hack together a preview of this in a branch and deploy it somewhere so people can see what I've got planned. Much easier to evaluate a working prototype than static examples. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
691323302 | https://github.com/simonw/datasette/issues/782#issuecomment-691323302 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDY5MTMyMzMwMg== | simonw 9599 | 2020-09-11T21:38:27Z | 2020-09-11T21:40:04Z | OWNER | Another idea: the default output could be the list of dicts:
``` ~ % curl -s -i 'https://api.github.com/repos/simonw/datasette/commits' | head -n 40 HTTP/1.1 200 OK server: GitHub.com date: Fri, 11 Sep 2020 21:37:46 GMT content-type: application/json; charset=utf-8 status: 200 OK cache-control: public, max-age=60, s-maxage=60 vary: Accept, Accept-Encoding, Accept, X-Requested-With etag: W/"71c99379743513394e880c6306b66bf9" last-modified: Fri, 11 Sep 2020 21:32:54 GMT x-github-media-type: github.v3; format=json link: https://api.github.com/repositories/107914493/commits?page=2; rel="next", https://api.github.com/repositories/107914493/commits?page=44; rel="last" access-control-expose-headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset access-control-allow-origin: * strict-transport-security: max-age=31536000; includeSubdomains; preload x-frame-options: deny x-content-type-options: nosniff x-xss-protection: 1; mode=block referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin content-security-policy: default-src 'none' X-Ratelimit-Limit: 60 X-Ratelimit-Remaining: 55 X-Ratelimit-Reset: 1599863850 X-Ratelimit-Used: 5 Accept-Ranges: bytes Content-Length: 118240 X-GitHub-Request-Id: EC76:0EAD:313F40:5291A4:5F5BEE37 [ { "sha": "d02f6151dae073135a22d0123e8abdc6cbef7c50", "node_id": "MDY6Q29tbWl0MTA3OTE0NDkzOmQwMmY2MTUxZGFlMDczMTM1YTIyZDAxMjNlOGFiZGM2Y2JlZjdjNTA=", "commit": { ``` Alternative shapes would provide the pagination information (and other extensions) in the JSON, e.g.:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
636370064 | https://github.com/simonw/datasette/issues/782#issuecomment-636370064 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDYzNjM3MDA2NA== | simonw 9599 | 2020-05-30T18:51:19Z | 2020-05-30T18:51:19Z | OWNER | https://latest.datasette.io/fixtures/compound_three_primary_keys.json?_size=2&_shape=array returns this:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Redesign default .json format 627794879 | |
636369978 | https://github.com/simonw/datasette/issues/782#issuecomment-636369978 | https://api.github.com/repos/simonw/datasette/issues/782 | MDEyOklzc3VlQ29tbWVudDYzNjM2OTk3OA== | simonw 9599 | 2020-05-30T18:50:31Z | 2020-05-30T18:50:31Z | OWNER | Here's the default JSON at the moment: https://latest.datasette.io/fixtures/compound_three_primary_keys.json?_size=2
It returns rows as a list of lists of values, and expects you to correlate these with the list of columns. I originally designed it like this because I thought this was a more efficient representation than repeating the column names in a dictionary for every row. With hindsight this was a bad optimization - I 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 |
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 1