{"html_url": "https://github.com/simonw/sqlite-utils/issues/589#issuecomment-1704384393", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/589", "id": 1704384393, "node_id": "IC_kwDOCGYnMM5llteJ", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-09-03T19:36:34Z", "updated_at": "2023-09-03T19:36:34Z", "author_association": "OWNER", "body": "Here's a prototype: https://github.com/simonw/sqlite-utils/commit/62f673835c4a66f87cf6f949eaff43c8b014619b\r\n\r\nStill needs tests and documentation (and some more thought to make sure it's doing the right thing).", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1879209560, "label": "Mechanism for de-registering registered SQL functions"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/589#issuecomment-1704384111", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/589", "id": 1704384111, "node_id": "IC_kwDOCGYnMM5lltZv", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-09-03T19:35:03Z", "updated_at": "2023-09-03T19:35:03Z", "author_association": "OWNER", "body": "Normally in Python/`sqlite3` you de-register a function by passing `None` to it.\r\n\r\nYou can't do that with `db.register_function()` at the moment because a `fn` of `None` does something else:\r\n\r\nhttps://github.com/simonw/sqlite-utils/blob/1260bdc7bfe31c36c272572c6389125f8de6ef71/sqlite_utils/db.py#L461-L464", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1879209560, "label": "Mechanism for de-registering registered SQL functions"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/589#issuecomment-1704383901", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/589", "id": 1704383901, "node_id": "IC_kwDOCGYnMM5lltWd", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-09-03T19:34:05Z", "updated_at": "2023-09-03T19:34:05Z", "author_association": "OWNER", "body": "For that particular case I realized I'd quite like to have a mechanism for applying functions for a block of code and then de-registering them at the end - a context manager.\r\n\r\nI played with this idea a bit:\r\n\r\n```python\r\nwith db.register_functions(md5, md5_random):\r\n db.query(...)\r\n```\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1879209560, "label": "Mechanism for de-registering registered SQL functions"}, "performed_via_github_app": null}