{"html_url": "https://github.com/simonw/datasette/issues/483#issuecomment-495032818", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/483", "id": 495032818, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NTAzMjgxOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-23T01:28:06Z", "updated_at": "2019-05-23T01:28:06Z", "author_association": "OWNER", "body": "Here's a UI concept:\r\n\r\n\"fixtures__facetable__15_rows\"\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 447408527, "label": "Option to facet by date using month or year"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/483#issuecomment-495032933", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/483", "id": 495032933, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NTAzMjkzMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-23T01:28:45Z", "updated_at": "2019-05-23T01:28:45Z", "author_association": "OWNER", "body": "Would this be useful for other facets? How many facet types are likely to have a small number of options that could be linked to in this way?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 447408527, "label": "Option to facet by date using month or year"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/483#issuecomment-495034774", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/483", "id": 495034774, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NTAzNDc3NA==", "user": {"value": 45919695, "label": "jcmkk3"}, "created_at": "2019-05-23T01:38:32Z", "updated_at": "2019-05-23T01:43:04Z", "author_association": "NONE", "body": "I think that location information is one of the other common pieces of hierarchical data. At least one that is general enough that extra dimensions could be auto-generated.\r\n\r\nAlso, I think this is an awesome project. Thank you for creating this.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 447408527, "label": "Option to facet by date using month or year"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/259#issuecomment-495058104", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/259", "id": 495058104, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NTA1ODEwNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-23T03:55:37Z", "updated_at": "2019-05-23T03:55:37Z", "author_association": "OWNER", "body": "I got rid of inspect in #462 - I will still be doing many-to-many detection (initially as part of #356) but it doesn't need a separate ticket.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 322787470, "label": "inspect() should detect many-to-many relationships"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/355#issuecomment-495058622", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/355", "id": 495058622, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NTA1ODYyMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-23T03:58:58Z", "updated_at": "2019-05-23T03:58:58Z", "author_association": "OWNER", "body": "So the design I have so far is:\r\n\r\n`?_m2m_linktablename__linktablecolumn=value`\r\n\r\nI'm concerned that this doesn't take tables or columns with `__` in their name into account. Does that matter? Could I support this without them?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 346027040, "label": "Table view should support filtering via many-to-many relationships"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/355#issuecomment-495058828", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/355", "id": 495058828, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NTA1ODgyOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-23T04:00:27Z", "updated_at": "2019-05-23T04:00:27Z", "author_association": "OWNER", "body": "The alternative would be to use JSON:\r\n\r\n`?_m2m={\"table\":\"ad_targets\",\"column\":\"target_id\",\"value\":\"ec3ac\"}`", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 346027040, "label": "Table view should support filtering via many-to-many relationships"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/355#issuecomment-495058964", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/355", "id": 495058964, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NTA1ODk2NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-23T04:01:17Z", "updated_at": "2019-05-23T04:01:17Z", "author_association": "OWNER", "body": "I think I like this better. I don't think `?_m2m=` is the correct name for it though.\r\n\r\n`?_through={\"table\":\"ad_targets\",\"column\":\"target_id\",\"value\":\"ec3ac\"}` feels a little more accurate.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 346027040, "label": "Table view should support filtering via many-to-many relationships"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/355#issuecomment-495059236", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/355", "id": 495059236, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NTA1OTIzNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-23T04:03:04Z", "updated_at": "2019-05-23T04:03:04Z", "author_association": "OWNER", "body": "This assumes that our current table has a single, unambiguous foreign key relationship with the table indicated by the `?through=` parameter.\r\n\r\nI think that's reasonable. The JSON format could be extended to allow that side of the relationship to optionally be defined there (if the foreign key relationship is missing).", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 346027040, "label": "Table view should support filtering via many-to-many relationships"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/355#issuecomment-495061686", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/355", "id": 495061686, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NTA2MTY4Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-23T04:21:00Z", "updated_at": "2019-05-23T04:21:00Z", "author_association": "OWNER", "body": "Filtering through one table already works - you need to know that table's primary key, then you do `?column_id=pk` against the first table.\r\n\r\nFiltering through a m2m table will be handled by the new `?_through=` parameter.\r\n\r\nI'm going to leave out filtering through a second levels of joins for the moment. Potentially that could be added later as some extra complicated JSON.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 346027040, "label": "Table view should support filtering via many-to-many relationships"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/484#issuecomment-495068273", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/484", "id": 495068273, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NTA2ODI3Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-23T05:03:48Z", "updated_at": "2019-05-23T05:04:35Z", "author_association": "OWNER", "body": "Ideally we would display a limited number of m2m related records with a \"...\" if there are more than our limit. I could also show a count of the total number of records, but this would have to be agressively time-limited or it could cause extremely poor performance.\r\n\r\nThis could be implemented as a SQL query for every displayed row, taking advantage of [Many Small Queries Are Efficient In SQLite](https://sqlite.org/np1queryprob.html). Provided that SQL runs against an index this should be fast to display even on a table with hundreds of rows.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 447451492, "label": "Mechanism for displaying summary of m2m relationships in rows on table view"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/355#issuecomment-495077443", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/355", "id": 495077443, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NTA3NzQ0Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-23T05:52:52Z", "updated_at": "2019-05-23T05:52:52Z", "author_association": "OWNER", "body": "Documentation here: https://datasette.readthedocs.io/en/latest/json_api.html#special-table-arguments", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 346027040, "label": "Table view should support filtering via many-to-many relationships"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/355#issuecomment-495077528", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/355", "id": 495077528, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NTA3NzUyOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-23T05:53:20Z", "updated_at": "2019-05-23T05:53:20Z", "author_association": "OWNER", "body": "Demo: https://latest.datasette.io/fixtures/roadside_attractions?_through={%22table%22:%22roadside_attraction_characteristics%22,%22column%22:%22characteristic_id%22,%22value%22:%221%22}", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 346027040, "label": "Table view should support filtering via many-to-many relationships"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/355#issuecomment-495079393", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/355", "id": 495079393, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NTA3OTM5Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-23T06:02:11Z", "updated_at": "2019-05-23T06:02:11Z", "author_association": "OWNER", "body": "I'm re-opening because we need a UI mechanism for deselecting this:\r\n\r\n\"fixtures__roadside_attractions__2_rows_where_where_roadside_attraction_characteristics_characteristic_id____1__and_fixtures__roadside_attractions__2_rows_where_w", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 346027040, "label": "Table view should support filtering via many-to-many relationships"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/355#issuecomment-495079705", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/355", "id": 495079705, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NTA3OTcwNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-23T06:03:40Z", "updated_at": "2019-05-23T06:04:03Z", "author_association": "OWNER", "body": "I think an approach similar to how `?_where=` works would do the job here.\r\n\r\nCan address this feedback from @psychemedia while I'm at it: https://github.com/simonw/datasette/issues/429#issuecomment-483202658\r\n\r\n![image](https://user-images.githubusercontent.com/82988/56127017-2bf78e80-5f74-11e9-9120-9393eb5d4988.png)", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 346027040, "label": "Table view should support filtering via many-to-many relationships"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/483#issuecomment-495080390", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/483", "id": 495080390, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NTA4MDM5MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-23T06:06:53Z", "updated_at": "2019-05-23T06:06:53Z", "author_association": "OWNER", "body": "Yes there's definitely something exciting to be done with location facets.\r\n\r\nThe easiest one would be a radius-distance-from-a-point facet (5km, 10km etc). A more sophisticated thing might be possible on top of GeoJSON and SpatiaLite - that's probably something I would put in a plugin rather than shipping in Datasette itself.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 447408527, "label": "Option to facet by date using month or year"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/483#issuecomment-495080591", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/483", "id": 495080591, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NTA4MDU5MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-23T06:07:53Z", "updated_at": "2019-05-23T06:09:05Z", "author_association": "OWNER", "body": "As far as URL design goes... I'm going to stick with `?_facet_date=` for this and use the not-yet-fully-baked JSON alternative syntax. Probably something like this:\r\n\r\n ?_facet_date={\"column\":\"created\",\"interval\":\"month\"}\r\n\r\nWhere interval can be day (the default), month or year. And maybe week? Not sure about that.\r\n\r\nStill not sure what/if I should do about exposing these options in the UI.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 447408527, "label": "Option to facet by date using month or year"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/485#issuecomment-495083670", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/485", "id": 495083670, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NTA4MzY3MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-23T06:21:52Z", "updated_at": "2019-05-23T06:22:36Z", "author_association": "OWNER", "body": "If a table has more than two columns we could do a betterl job at guessing the label column. A few potential tricks:\r\n\r\n\r\n* look for a column called name or title\r\n* look for the first column of type text\r\n* check for the text column with the most diversity in values", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 447469253, "label": "Improvements to table label detection "}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/485#issuecomment-495085021", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/485", "id": 495085021, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NTA4NTAyMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-23T06:27:57Z", "updated_at": "2019-05-26T23:15:51Z", "author_association": "OWNER", "body": "I could attempt to calculate the statistics needed for this in a time limited SQL query something like this one: https://latest.datasette.io/fixtures?sql=select+%27name%27+as+column%2C+count+%28distinct+name%29+as+count_distinct%2C+avg%28length%28name%29%29+as+avg_length+from+roadside_attractions%0D%0A++union%0D%0Aselect+%27address%27+as+column%2C+count%28distinct+address%29+as+count_distinct%2C+avg%28length%28address%29%29+as+avg_length+from+roadside_attractions\r\n\r\n```\r\nselect 'name' as column, count (distinct name) as count_distinct, avg(length(name)) as avg_length from roadside_attractions\r\n union\r\nselect 'address' as column, count(distinct address) as count_distinct, avg(length(address)) as avg_length from roadside_attractions\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 447469253, "label": "Improvements to table label detection "}, "performed_via_github_app": null}