{"html_url": "https://github.com/simonw/sqlite-utils/issues/117#issuecomment-648442511", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/117", "id": 648442511, "node_id": "MDEyOklzc3VlQ29tbWVudDY0ODQ0MjUxMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-23T21:39:41Z", "updated_at": "2020-06-23T21:39:41Z", "author_association": "OWNER", "body": "So there are two sides to supporting this:\r\n\r\n- Being able to sensibly introspect composite foreign keys\r\n- Being able to define composite foreign keys when creating a table", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 644161221, "label": "Support for compound (composite) foreign keys"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/117#issuecomment-648440634", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/117", "id": 648440634, "node_id": "MDEyOklzc3VlQ29tbWVudDY0ODQ0MDYzNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-23T21:35:16Z", "updated_at": "2020-06-23T21:35:16Z", "author_association": "OWNER", "body": "Relevant discussion: https://github.com/simonw/sqlite-generate/issues/8#issuecomment-648438056", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 644161221, "label": "Support for compound (composite) foreign keys"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/117#issuecomment-648440525", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/117", "id": 648440525, "node_id": "MDEyOklzc3VlQ29tbWVudDY0ODQ0MDUyNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-23T21:35:01Z", "updated_at": "2020-06-23T21:35:01Z", "author_association": "OWNER", "body": "Here's what's missing:\r\n```\r\nIn [11]: db.conn.execute('PRAGMA foreign_key_list(song)').fetchall() \r\nOut[11]: \r\n[(0,\r\n 0,\r\n 'album',\r\n 'songartist',\r\n 'albumartist',\r\n 'NO ACTION',\r\n 'NO ACTION',\r\n 'NONE'),\r\n (0, 1, 'album', 'songalbum', 'albumname', 'NO ACTION', 'NO ACTION', 'NONE')]\r\n```\r\nCompare with this code here:\r\nhttps://github.com/simonw/sqlite-utils/blob/d0cdaaaf00249230e847be3a3b393ee2689fbfe4/sqlite_utils/db.py#L563-L579\r\n\r\nThe first two columns returned by `PRAGMA foreign_key_list(table)` are `id` and `seq` - these show when two foreign key records are part of the same compound foreign key. `sqlite-utils` entirely ignores those at the moment.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 644161221, "label": "Support for compound (composite) foreign keys"}, "performed_via_github_app": null}