{"html_url": "https://github.com/simonw/datasette/issues/782#issuecomment-1368269732", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 1368269732, "node_id": "IC_kwDOBm6k_c5RjiOk", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-31T19:32:33Z", "updated_at": "2023-01-17T02:05:45Z", "author_association": "OWNER", "body": "New thinking on the trimmed-down default. Previously I was going to use `\"row\"` and `\"next_url\"` - I now want to do this instead:\r\n```json\r\n{\r\n \"ok\": true,\r\n \"rows\": [\r\n {\r\n \"pk1\": \"a\",\r\n \"pk2\": \"a\",\r\n \"pk3\": \"a\",\r\n \"content\": \"a-a-a\"\r\n },\r\n {\r\n \"pk1\": \"a\",\r\n \"pk2\": \"a\",\r\n \"pk3\": \"b\",\r\n \"content\": \"a-a-b\"\r\n }\r\n ],\r\n \"next\": \"a,a,b\"\r\n}\r\n```\r\nIf there isn't a next page it will return `\"next\": null`.\r\n\r\nThis is even more succinct. I'm OK with people having to request `next_url` if they don't want to construct the new URL themselves.\r\n\r\nThe `\"ok\": true` is there so it can be `false` for errors, consistently.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 627794879, "label": "Redesign default .json format"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/782#issuecomment-1368285442", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 1368285442, "node_id": "IC_kwDOBm6k_c5RjmEC", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-31T22:02:16Z", "updated_at": "2022-12-31T22:02:16Z", "author_association": "OWNER", "body": "https://latest.datasette.io/fixtures/compound_three_primary_keys.json?_size=2 now returns `count`:\r\n\r\n```json\r\n{\r\n \"database\": \"fixtures\",\r\n \"table\": \"compound_three_primary_keys\",\r\n \"is_view\": false,\r\n \"human_description_en\": \"\",\r\n \"rows\": [\r\n {\r\n \"pk1\": \"a\",\r\n \"pk2\": \"a\",\r\n \"pk3\": \"a\",\r\n \"content\": \"a-a-a\"\r\n },\r\n {\r\n \"pk1\": \"a\",\r\n \"pk2\": \"a\",\r\n \"pk3\": \"b\",\r\n \"content\": \"a-a-b\"\r\n }\r\n ],\r\n \"truncated\": false,\r\n \"count\": 1001,\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 627794879, "label": "Redesign default .json format"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/782#issuecomment-1368278278", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 1368278278, "node_id": "IC_kwDOBm6k_c5RjkUG", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-31T20:49:38Z", "updated_at": "2022-12-31T20:49:38Z", "author_association": "OWNER", "body": "I'm going to rename `filtered_table_rows_count` to `count` - to match the SQL `count(*)` function.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 627794879, "label": "Redesign default .json format"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/782#issuecomment-1368269811", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 1368269811, "node_id": "IC_kwDOBm6k_c5RjiPz", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-31T19:33:09Z", "updated_at": "2022-12-31T19:33:09Z", "author_association": "OWNER", "body": "Here's the so-far updated documentation for this change: https://github.com/simonw/datasette/blob/a2dca62360ad4a961d4c46f68eae41b7d5c7b2c9/docs/json_api.rst#different-shapes", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 627794879, "label": "Redesign default .json format"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/782#issuecomment-1368269283", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 1368269283, "node_id": "IC_kwDOBm6k_c5RjiHj", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-31T19:29:45Z", "updated_at": "2022-12-31T19:29:45Z", "author_association": "OWNER", "body": "https://latest.datasette.io/fixtures/compound_three_primary_keys.json?_size=2 now shows the new default:\r\n```json\r\n{\r\n \"database\": \"fixtures\",\r\n \"table\": \"compound_three_primary_keys\",\r\n \"is_view\": false,\r\n \"human_description_en\": \"\",\r\n \"rows\": [\r\n {\r\n \"pk1\": \"a\",\r\n \"pk2\": \"a\",\r\n \"pk3\": \"a\",\r\n \"content\": \"a-a-a\"\r\n },\r\n {\r\n \"pk1\": \"a\",\r\n \"pk2\": \"a\",\r\n \"pk3\": \"b\",\r\n \"content\": \"a-a-b\"\r\n }\r\n ],\r\n```\r\nThe old format can be had like this: https://latest.datasette.io/fixtures/compound_three_primary_keys.json?_size=2&_shape=arrays", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 627794879, "label": "Redesign default .json format"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/782#issuecomment-1368268148", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 1368268148, "node_id": "IC_kwDOBm6k_c5Rjh10", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-31T19:22:07Z", "updated_at": "2022-12-31T19:22:07Z", "author_association": "OWNER", "body": "It turned out the most significant part of this change - switching from an array of arrays to an array of objects for the `\"rows\"` key - was really easy: Datasette already had a `?_shape=arrays` v.s. `?_shape=objects` mechanism, so I switched which one was the default in https://github.com/simonw/datasette/commit/234230e59574ccb8d8a24c45ccd325f725812377", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 627794879, "label": "Redesign default .json format"}, "performed_via_github_app": null}