id,node_id,number,state,locked,title,user,body,created_at,updated_at,closed_at,merged_at,merge_commit_sha,assignee,milestone,draft,head,base,author_association,repo,url,merged_by,auto_merge 521287994,MDExOlB1bGxSZXF1ZXN0NTIxMjg3OTk0,203,open,0,changes to allow for compound foreign keys,1049910,"Add support for compound foreign keys, as per issue #117 Not sure if this is the right approach. In particular I'm unsure about: - the new `ForeignKey` class, which replaces the namedtuple in order to ensure that `column` and `other_column` are forced into tuples. The class does the job, but doesn't feel very elegant. - I haven't rewritten `guess_foreign_table` to take account of multiple columns, so it just checks for the first column in the foreign key definition. This isn't ideal. - I haven't added any ability to the CLI to add compound foreign keys, it's only in the python API at the moment. The PR also contains a minor related change that columns and tables are always quoted in foreign key definitions.",2020-11-16T00:30:10Z,2023-01-25T18:47:18Z,,,0507a9464314f84e9e58b1931c583df51d757d7c,,,0,5e43e31c2b9bcf6b5d1460b0f848fed019ed42a6,f1277f638f3a54a821db6e03cb980adad2f2fa35,FIRST_TIME_CONTRIBUTOR,140912432,https://github.com/simonw/sqlite-utils/pull/203,, 1215742203,PR_kwDOBm6k_c5IdsD7,2003,open,0,Show referring tables and rows when the referring foreign key is compound,536941,"sqlite foreign keys can be compound, but that is not as well supported by datasette as single column foreign keys. in particular, 1. in a table view, there is not a link from the row to the referenced row if the foreign key is compound 2. in a row view, there is no listing of tables and rows that refer to the focal row if those referencing foreign keys are compound. Both of these issues are discussed in #1099. This PR only fixes the second one, because it's not clear what the right UX is for the first issue. ![Screenshot 2023-01-24 at 19-47-40 nlrb bargaining_unit](https://user-images.githubusercontent.com/536941/214454749-d53deead-4151-4329-a5d4-8a7a454de7d3.png) Some things that might not be desirable about this approach. 1. it changes the external API, by changing `column` => `columns` and `other_column` => `other_columns` (see inline comment for more discussion. 2. There are various places where the plural foreign keys have to be checked for length and discarded or transformed to singular. ",2023-01-24T21:31:31Z,2023-01-25T18:44:42Z,,,fb3abeceb2785a582d2c120c7c1bf7dc3cd1de05,,,0,1e5b42f9d6490926300953837cbaa571ef81d772,e4ebef082de90db4e1b8527abc0d582b7ae0bc9d,CONTRIBUTOR,107914493,https://github.com/simonw/datasette/pull/2003,,