{"html_url": "https://github.com/simonw/datasette/issues/782#issuecomment-636370064", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 636370064, "node_id": "MDEyOklzc3VlQ29tbWVudDYzNjM3MDA2NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-30T18:51:19Z", "updated_at": "2020-05-30T18:51:19Z", "author_association": "OWNER", "body": "https://latest.datasette.io/fixtures/compound_three_primary_keys.json?_size=2&_shape=array returns this:\r\n```json\r\n[\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\nThere's one big problem with this format: it doesn't provide any space for pagination information.", "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-636369978", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 636369978, "node_id": "MDEyOklzc3VlQ29tbWVudDYzNjM2OTk3OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-30T18:50:31Z", "updated_at": "2020-05-30T18:50:31Z", "author_association": "OWNER", "body": "Here's the default JSON at the moment: https://latest.datasette.io/fixtures/compound_three_primary_keys.json?_size=2\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 \"a\",\r\n \"a\",\r\n \"a\",\r\n \"a-a-a\"\r\n ],\r\n [\r\n \"a\",\r\n \"a\",\r\n \"b\",\r\n \"a-a-b\"\r\n ]\r\n ],\r\n \"truncated\": false,\r\n \"filtered_table_rows_count\": 1001,\r\n \"expanded_columns\": [],\r\n \"expandable_columns\": [],\r\n \"columns\": [\r\n \"pk1\",\r\n \"pk2\",\r\n \"pk3\",\r\n \"content\"\r\n ],\r\n \"primary_keys\": [\r\n \"pk1\",\r\n \"pk2\",\r\n \"pk3\"\r\n ],\r\n \"units\": {},\r\n \"query\": {\r\n \"sql\": \"select pk1, pk2, pk3, content from compound_three_primary_keys order by pk1, pk2, pk3 limit 3\",\r\n \"params\": {}\r\n },\r\n \"facet_results\": {},\r\n \"suggested_facets\": [\r\n {\r\n \"name\": \"pk1\",\r\n \"toggle_url\": \"http://latest.datasette.io/fixtures/compound_three_primary_keys.json?_size=2&_facet=pk1\"\r\n },\r\n {\r\n \"name\": \"pk2\",\r\n \"toggle_url\": \"http://latest.datasette.io/fixtures/compound_three_primary_keys.json?_size=2&_facet=pk2\"\r\n },\r\n {\r\n \"name\": \"pk3\",\r\n \"toggle_url\": \"http://latest.datasette.io/fixtures/compound_three_primary_keys.json?_size=2&_facet=pk3\"\r\n }\r\n ],\r\n \"next\": \"a,a,b\",\r\n \"next_url\": \"http://latest.datasette.io/fixtures/compound_three_primary_keys.json?_size=2&_next=a%2Ca%2Cb\",\r\n \"query_ms\": 17.56119728088379,\r\n \"source\": \"tests/fixtures.py\",\r\n \"source_url\": \"https://github.com/simonw/datasette/blob/master/tests/fixtures.py\",\r\n \"license\": \"Apache License 2.0\",\r\n \"license_url\": \"https://github.com/simonw/datasette/blob/master/LICENSE\"\r\n}\r\n```\r\nThere's a lot of stuff in there. This increases the risk that future minor changes might break existing API consumers.\r\n\r\nIt 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 `?shape=array` because it's more convenient, and gzip encoding of the response means there's no bandwidth saving. Users who want that efficiency should request it using a custom `?_shape=`.", "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}