{"html_url": "https://github.com/simonw/datasette/issues/1886#issuecomment-1313252879", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1886", "id": 1313252879, "node_id": "IC_kwDOBm6k_c5ORqYP", "user": {"value": 883348, "label": "adipasquale"}, "created_at": "2022-11-14T08:10:23Z", "updated_at": "2022-11-14T08:10:23Z", "author_association": "CONTRIBUTOR", "body": "Hi @simonw and thanks for the great tools you're publishing, your dedication is inspiring!\r\n\r\nI work for the French Ministry of Culture on a surveying tool for objects protected for their historical value. It is part of a program building modern public services called [beta.gouv.fr](https://beta.gouv.fr/).\r\n\r\nIn that context I'm using data published by the Ministry that I have ingested into datasette and published on a free Fly instance : https://collectif-objets-datasette.fly.dev . I have also ingested another data set with infos about french cities on this instance so that I can perform joined queries.\r\n\r\nThe surveying tool synchronizes its data regularly from this datasette instance, and I also use it to perform queries when asked generic questions about the distribution of objects. (The data is not very accessible as it's undocumented and for internal usage mostly)", "reactions": "{\"total_count\": 3, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 3, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1447050738, "label": "Call for birthday presents: if you're using Datasette, let us know how you're using it here"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/235#issuecomment-1223378004", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/235", "id": 1223378004, "node_id": "IC_kwDOCGYnMM5I60RU", "user": {"value": 1558033, "label": "wpears"}, "created_at": "2022-08-23T00:44:11Z", "updated_at": "2022-08-23T00:44:11Z", "author_association": "NONE", "body": "This bug affects me as well. Env:\r\n\r\n```\r\nPython 3.8.12\r\nsqlite-utils, version 3.28\r\nsqlite3 3.32.3\r\nMacOS Big Sur 11.6.7\r\nIntel\r\n```\r\n\r\nSimilar to @mdrovdahl, I was able to work around this bug by piping the SQL string constructed in `add_foreign_keys` to the `sqlite3` command itself. Specifically, if you're trying to patch this yourself, replace [lines 1026-1039 of db.py in your site packages](https://github.com/simonw/sqlite-utils/blob/main/sqlite_utils/db.py#L1026-L1039) with something similar to the following:\r\n\r\n```\r\nprint(\"PRAGMA writable_schema = 1;\")\r\nfor table_name, new_sql in table_sql.items():\r\n print(\"UPDATE sqlite_master SET sql = '{}' WHERE name = '{}';\".format(\r\n new_sql, table_name)\r\n )\r\nprint(\"PRAGMA writable_schema = 0;\")\r\nprint(\"VACUUM;\")\r\n```\r\n \r\nThen from your terminal:\r\n`db-to-sqlite \"\" your.db --all > output.sql && sqlite3 your.db < output.sql`\r\n\r\nIf you want to run this with `-p`, you'll have to actually open a file in code to write to instead of redirecting the output.", "reactions": "{\"total_count\": 3, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 3, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 810618495, "label": "Extract columns cannot create foreign key relation: sqlite3.OperationalError: table sqlite_master may not be modified"}, "performed_via_github_app": null}