{"html_url": "https://github.com/simonw/datasette/issues/782#issuecomment-712986115", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 712986115, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMjk4NjExNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-20T16:28:46Z", "updated_at": "2020-10-20T16:29:51Z", "author_association": "OWNER", "body": "I think this all comes down to how the `?_extras=` mechanism works (see #262), as first hinted at in a30c5b220c15360d575e94b0e67f3255e120b916 (see commit message) when I added this long-forgotten undocumented feature: https://latest.datasette.io/fixtures/attraction_characteristic/2.json?_extras=foreign_key_tables\r\n\r\nExtras 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 `.json` output even when its results are not being shown.", "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-712590398", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 712590398, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMjU5MDM5OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-20T05:03:46Z", "updated_at": "2020-10-20T05:04:09Z", "author_association": "OWNER", "body": "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\r\n\r\n```json\r\n{\r\n \"rows\": [\r\n {\r\n \"pk\": 1,\r\n \"name\": \"The Mystery Spot\",\r\n \"address\": \"465 Mystery Spot Road, Santa Cruz, CA 95065\",\r\n \"latitude\": 37.0167,\r\n \"longitude\": -122.0024\r\n },\r\n {\r\n \"pk\": 2,\r\n \"name\": \"Winchester Mystery House\",\r\n \"address\": \"525 South Winchester Boulevard, San Jose, CA 95128\",\r\n \"latitude\": 37.3184,\r\n \"longitude\": -121.9511\r\n },\r\n {\r\n \"pk\": 3,\r\n \"name\": \"Burlingame Museum of PEZ Memorabilia\",\r\n \"address\": \"214 California Drive, Burlingame, CA 94010\",\r\n \"latitude\": 37.5793,\r\n \"longitude\": -122.3442\r\n },\r\n {\r\n \"pk\": 4,\r\n \"name\": \"Bigfoot Discovery Museum\",\r\n \"address\": \"5497 Highway 9, Felton, CA 95018\",\r\n \"latitude\": 37.0414,\r\n \"longitude\": -122.0725\r\n }\r\n ],\r\n \"total\": 4,\r\n \"next_url\": null\r\n}\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-712585921", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 712585921, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMjU4NTkyMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-20T04:48:01Z", "updated_at": "2020-10-20T04:48:01Z", "author_association": "OWNER", "body": "I'll update `datasette-json-preview` with that now.", "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-712585687", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 712585687, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMjU4NTY4Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-20T04:47:02Z", "updated_at": "2020-10-20T04:47:12Z", "author_association": "OWNER", "body": "Great point about CORS, I hadn't considered that.\r\n\r\nI think I'm going to keep the `Link:` header (added in #1014) because I quite enjoy using it with GitHub and WordPress, but I'm not going to have it be the default way of doing pagination. For the default shape I'm now leaning towards this:\r\n\r\n```json\r\n{\r\n \"total\": 36,\r\n \"rows\": [{\"id\": 1, \"name\": \"Cleo\"}],\r\n \"next_url\": \"https://latest-with-plugins.datasette.io/fixtures/facetable.json?_next=5\"\r\n}\r\n```\r\n\r\nSo three keys: `total`, `rows` and `next_url`. Then extra keys can be added using `?_extra=` with various named bundles.", "reactions": "{\"total_count\": 3, \"+1\": 3, \"-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-712569695", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/782", "id": 712569695, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMjU2OTY5NQ==", "user": {"value": 222245, "label": "carlmjohnson"}, "created_at": "2020-10-20T03:45:48Z", "updated_at": "2020-10-20T03:46:14Z", "author_association": "NONE", "body": "I vote against headers. It has a lot of strikes against it: poor discoverability, new developers often don\u2019t know how to use them, makes CORS harder, makes it hard to use eg with JQ, needs ad hoc specification for each bit of metadata, etc. \r\n\r\nThe only advantage of headers is that you don\u2019t need to do .rows, but that\u2019s actually good as a data validation step anyway\u2014if .rows is missing assume there\u2019s an error and do your error handling path instead of parsing the rest.", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-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}