{"html_url": "https://github.com/simonw/sqlite-utils/issues/132#issuecomment-671151461", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/132", "id": 671151461, "node_id": "MDEyOklzc3VlQ29tbWVudDY3MTE1MTQ2MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-10T03:54:06Z", "updated_at": "2020-08-10T03:54:06Z", "author_association": "OWNER", "body": "For the moment I'll build it without the `--retry` mode.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 675839512, "label": "Features for enabling and disabling WAL mode"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/132#issuecomment-671151170", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/132", "id": 671151170, "node_id": "MDEyOklzc3VlQ29tbWVudDY3MTE1MTE3MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-10T03:52:02Z", "updated_at": "2020-08-10T03:52:02Z", "author_association": "OWNER", "body": "I'm having trouble figuring out how to write a test that locks a SQLite database (so I can test that `--retry` actually works). I tried this recipe but it didn't seem to prevent another process from running `pragma journal_mode='wal';` against that database:\r\n\r\n```python\r\nimport time\r\nimport sys\r\nimport sqlite3\r\n\r\nfilename = sys.argv[-1]\r\n\r\ndb = sqlite3.connect(filename)\r\nwith db:\r\n db.execute(\"create table if not exists counter(id integer primary key, counter text)\")\r\n time.sleep(100)\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 675839512, "label": "Features for enabling and disabling WAL mode"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/132#issuecomment-671147344", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/132", "id": 671147344, "node_id": "MDEyOklzc3VlQ29tbWVudDY3MTE0NzM0NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-10T03:29:00Z", "updated_at": "2020-08-10T03:29:00Z", "author_association": "OWNER", "body": "The CLI options should take multiple database files:\r\n\r\n $ sqlite-utils enable-wal *.db\r\n\r\nIt's possible for this to fail if the DB is locked. How about a `--retry` option that causes it to retry a bunch of times if that happens?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 675839512, "label": "Features for enabling and disabling WAL mode"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/132#issuecomment-671147148", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/132", "id": 671147148, "node_id": "MDEyOklzc3VlQ29tbWVudDY3MTE0NzE0OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-10T03:27:50Z", "updated_at": "2020-08-10T03:27:50Z", "author_association": "OWNER", "body": "https://www.sqlite.org/pragma.html#pragma_journal_mode lists six modes: DELETE | TRUNCATE | PERSIST | MEMORY | WAL | OFF\r\n\r\nI'm only going to implement utilities for DELETE (wal-off) and WAL (wal-on) - the other modes look like they're for specialist purposes that I don't need to support.\r\n\r\nIf it turns out I do need them I can add those to `sqlite-utils` later.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 675839512, "label": "Features for enabling and disabling WAL mode"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/132#issuecomment-671146948", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/132", "id": 671146948, "node_id": "MDEyOklzc3VlQ29tbWVudDY3MTE0Njk0OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-08-10T03:26:51Z", "updated_at": "2020-08-10T03:26:51Z", "author_association": "OWNER", "body": "For the CLI:\r\n\r\n $ sqlite-utils enable-wal github.db\r\n $ sqlite-utils disable-wal github.db\r\n\r\nFor the Python library:\r\n\r\n```python\r\nimport sqlite_utils\r\n\r\ndb = sqlite_utils.Database(\"github.db\")\r\ndb.enable_wal()\r\ndb.disable_wal()\r\nmode = db.journal_mode # \"wal\" or \"delete\" or others\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 675839512, "label": "Features for enabling and disabling WAL mode"}, "performed_via_github_app": null}