{"html_url": "https://github.com/simonw/datasette/issues/767#issuecomment-632555800", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/767", "id": 632555800, "node_id": "MDEyOklzc3VlQ29tbWVudDYzMjU1NTgwMA==", "user": {"value": 2657547, "label": "rixx"}, "created_at": "2020-05-22T08:00:23Z", "updated_at": "2020-05-22T08:00:23Z", "author_association": "CONTRIBUTOR", "body": "That would be perfect!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 620969465, "label": "Allow to specify a URL fragment for canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/767#issuecomment-632398475", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/767", "id": 632398475, "node_id": "MDEyOklzc3VlQ29tbWVudDYzMjM5ODQ3NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-21T23:36:00Z", "updated_at": "2020-05-21T23:36:00Z", "author_association": "OWNER", "body": "Interesting. So this would take effect exclusively on pages that link to the queries, which I think just means this page: https://latest.datasette.io/fixtures\r\n\r\nHow about this for the design: there's a new optional key in the metadata configuration for a query called `\"fragment\"` - used like this:\r\n\r\n```json\r\n{\r\n \"databases\": {\r\n \"fixtures\": {\r\n \"queries\": {\r\n \"neighborhood_search\": {\r\n \"sql\": \"\\nselect neighborhood, facet_cities.name, state\\nfrom facetable\\n join facet_cities\\n on facetable.city_id = facet_cities.id\\nwhere neighborhood like '%' || :text || '%'\\norder by neighborhood;\\n\",\r\n \"title\": \"Search neighborhoods\",\r\n \"description_html\": \"Demonstrating simple like search\",\r\n \"name\": \"neighborhood_search\",\r\n \"fragment\": \"sql-format\"\r\n }\r\n }\r\n }\r\n }\r\n}\r\n```\r\nBecause of the `\"fragment\": \"sql-format\"` bit there the link to that query from https://latest.datasette.io/fixtures would be to `https://latest.datasette.io/fixtures/neighborhood_search#sql-format`.\r\n\r\nDoes that cover what you need here? Have I missed anything?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 620969465, "label": "Allow to specify a URL fragment for canned queries"}, "performed_via_github_app": null}