{"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/259#issuecomment-409087501", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/259", "id": 409087501, "node_id": "MDEyOklzc3VlQ29tbWVudDQwOTA4NzUwMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-07-31T04:03:29Z", "updated_at": "2018-07-31T04:03:29Z", "author_association": "OWNER", "body": "Parent ticket: #354", "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/259#issuecomment-392214791", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/259", "id": 392214791, "node_id": "MDEyOklzc3VlQ29tbWVudDM5MjIxNDc5MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-05-25T23:43:15Z", "updated_at": "2018-07-29T00:56:03Z", "author_association": "OWNER", "body": "We may need to derive a usable name for each of these relationships that can be used in eg querystring parameters.\r\n\r\nThe name of the join table is a reasonable choice here. Say the join table is called `event_tags` - the querystring for returning all events that are tagged `badger` could be `/db/events?_m2m_event_tags__tag=badger` perhaps?\r\n\r\nBut what if `event_tags` has more than one foreign key back to `events`? Might need to specify the column in `events` that is referred back to by `event_tags` somehow in that case.", "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/259#issuecomment-399157944", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/259", "id": 399157944, "node_id": "MDEyOklzc3VlQ29tbWVudDM5OTE1Nzk0NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-06-21T16:07:49Z", "updated_at": "2018-06-21T16:07:49Z", "author_association": "OWNER", "body": "Thanks to #319 the test suite now includes a m2m table: https://latest.datasette.io/fixtures-e14e080/searchable_tags", "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/259#issuecomment-392212119", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/259", "id": 392212119, "node_id": "MDEyOklzc3VlQ29tbWVudDM5MjIxMjExOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-05-25T23:22:26Z", "updated_at": "2018-05-25T23:22:26Z", "author_association": "OWNER", "body": "This should detect any table which can be linked to the current table via some other table, based on the other table having a foreign key to them both.\r\n\r\nThese join tables could be arbitrarily complicated. They might have foreign keys to more than two other tables, maybe even multiple foreign keys to the same column.\r\n\r\nIdeally M2M defection would catch all of these cases. Maybe the resulting inspect data looks something like this:\r\n\r\n```\r\n\"artists\": {\r\n ...\r\n \"m2m\": [{\r\n \"other_table\": \"festivals\",\r\n \"through\": \"performances\",\r\n \"our_fk\": \"artist_id\",\r\n \"other_fk\": \"performance_id\"\r\n }]\r\n```\r\n\r\nLet's ignore compound primary keys: we k it detect m2m relationships where the join table has foreign keys to a single primary key on the other two tables.", "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/259#issuecomment-388797919", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/259", "id": 388797919, "node_id": "MDEyOklzc3VlQ29tbWVudDM4ODc5NzkxOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-05-14T12:23:11Z", "updated_at": "2018-05-14T12:23:11Z", "author_association": "OWNER", "body": "For M2M to work we will need a mechanism for applying IN queries to the table view, so you can select multiple M2M filters. Maybe this would work:\r\n\r\n ?_m2m_category=123&_m2m_category=865", "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}