home / github / issue_comments

Menu
  • GraphQL API

issue_comments: 1683066934

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions issue performed_via_github_app
https://github.com/simonw/sqlite-utils/issues/577#issuecomment-1683066934 https://api.github.com/repos/simonw/sqlite-utils/issues/577 1683066934 IC_kwDOCGYnMM5kUZA2 9599 2023-08-17T22:37:18Z 2023-08-17T22:37:18Z OWNER I'm certain this could work. It turns out the `.transform()` method already has code that creates the new table with a copy of foreign keys from the old one - dropping any foreign keys that were specified in the `drop_foreign_keys=` parameter: https://github.com/simonw/sqlite-utils/blob/1dc6b5aa644a92d3654f7068110ed7930989ce71/sqlite_utils/db.py#L1850-L1872 Improving this code to support adding foreign keys as well would be pretty simple. And then the `.add_foreign_keys()` and `.add_foreign_key()` methods could be updated to use `.transform(...)` under the hood instead. {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} 1817289521  
Powered by Datasette · Queries took 0.884ms