{"html_url": "https://github.com/simonw/datasette/issues/342#issuecomment-404953877", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/342", "id": 404953877, "node_id": "MDEyOklzc3VlQ29tbWVudDQwNDk1Mzg3Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-07-13T21:05:12Z", "updated_at": "2018-07-13T21:05:12Z", "author_association": "OWNER", "body": "That's a good idea. We already do this for tables - e.g. on https://fivethirtyeight.datasettes.com/fivethirtyeight-ac35616/most-common-name%2Fsurnames - so having it as an option for canned queries definitely makes sense.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 341123355, "label": "Requesting support for query description"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/342#issuecomment-404954202", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/342", "id": 404954202, "node_id": "MDEyOklzc3VlQ29tbWVudDQwNDk1NDIwMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-07-13T21:06:53Z", "updated_at": "2018-07-13T21:07:13Z", "author_association": "OWNER", "body": "https://timezones-api.now.sh/-/metadata currently shows this:\r\n```\r\n{\r\n \"databases\": {\r\n \"timezones\": {\r\n \"license\": \"ODbL\",\r\n \"license_url\": \"http://opendatacommons.org/licenses/odbl/\",\r\n \"queries\": {\r\n \"by_point\": \"select tzid\\nfrom\\n timezones\\nwhere\\n within(GeomFromText(\\u0027POINT(\\u0027 || :longitude || \\u0027 \\u0027 || :latitude || \\u0027)\\u0027), timezones.Geometry)\\n and rowid in (\\n SELECT pkid FROM idx_timezones_Geometry\\n where xmin \\u003c :longitude\\n and xmax \\u003e :longitude\\n and ymin \\u003c :latitude\\n and ymax \\u003e :latitude\\n )\"\r\n },\r\n \"source\": \"timezone-boundary-builder\",\r\n \"source_url\": \"https://github.com/evansiroky/timezone-boundary-builder\",\r\n \"tables\": {\r\n \"timezones\": {\r\n \"license\": \"ODbL\",\r\n \"license_url\": \"http://opendatacommons.org/licenses/odbl/\",\r\n \"sortable_columns\": [\r\n \"tzid\"\r\n ],\r\n \"source\": \"timezone-boundary-builder\",\r\n \"source_url\": \"https://github.com/evansiroky/timezone-boundary-builder\"\r\n }\r\n }\r\n }\r\n },\r\n \"license\": \"ODbL\",\r\n \"license_url\": \"http://opendatacommons.org/licenses/odbl/\",\r\n \"source\": \"timezone-boundary-builder\",\r\n \"source_url\": \"https://github.com/evansiroky/timezone-boundary-builder\",\r\n \"title\": \"OpenStreetMap Time Zone Boundaries\"\r\n}\r\n```\r\n\r\nWe could support the value part of the `\"queries\"` array optionally being a dictionary with the same set of metadata fields supported for a table, plus a new `\"sql\"` key to hold the SQL for the query.\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 341123355, "label": "Requesting support for query description"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/342#issuecomment-404954672", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/342", "id": 404954672, "node_id": "MDEyOklzc3VlQ29tbWVudDQwNDk1NDY3Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-07-13T21:09:01Z", "updated_at": "2018-07-13T21:09:01Z", "author_association": "OWNER", "body": "So it would look like this:\r\n```\r\n{\r\n \"databases\": {\r\n \"timezones\": {\r\n \"license\": \"ODbL\",\r\n \"license_url\": \"http://opendatacommons.org/licenses/odbl/\",\r\n \"queries\": {\r\n \"by_point\": {\r\n \"title\": \"Timezones by point\",\r\n \"description\": \"Find the timezone for a latitude/longitude point\",\r\n \"sql\": \"select tzid\\nfrom\\n timezones\\nwhere\\n within(GeomFromText('POINT(' || :longitude || ' ' || :latitude || ')'), timezones.Geometry)\\n and rowid in (\\n SELECT pkid FROM idx_timezones_Geometry\\n where xmin < :longitude\\n and xmax > :longitude\\n and ymin < :latitude\\n and ymax > :latitude\\n )\"\r\n }\r\n }\r\n }\r\n }\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": 341123355, "label": "Requesting support for query description"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/342#issuecomment-405138460", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/342", "id": 405138460, "node_id": "MDEyOklzc3VlQ29tbWVudDQwNTEzODQ2MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-07-16T02:42:32Z", "updated_at": "2018-07-16T02:42:32Z", "author_association": "OWNER", "body": "Demos:\r\n\r\n* https://latest.datasette.io/fixtures/neighborhood_search\r\n* https://timezones-api.now.sh/timezones/by_point\r\n\r\nDocumentation: http://datasette.readthedocs.io/en/latest/sql_queries.html#canned-queries", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 341123355, "label": "Requesting support for query description"}, "performed_via_github_app": null}