{"html_url": "https://github.com/simonw/datasette/issues/2000#issuecomment-1399847946", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2000", "id": 1399847946, "node_id": "IC_kwDOBm6k_c5Tb_wK", "user": {"value": 193185, "label": "cldellow"}, "created_at": "2023-01-23T06:08:00Z", "updated_at": "2023-01-23T06:08:00Z", "author_association": "CONTRIBUTOR", "body": "Actually, I discovered [your post](https://til.simonwillison.net/datasette/register-new-plugin-hooks) showing how a plugin can add a Datasette hook. That's wild! I've released `datasette-rewrite-sql` that adds this ability, albeit via monkey patching.\r\n\r\nI had hoped to be able to expose `request` to the hook (or, even better `actor`) when the SQL was being run as a result of a user's HTTP request.\r\n\r\nBut some spelunking in the code makes me suspect that would actually require co-operation from Datasette itself. I'd be happy to be wrong and pointed in the right direction, though!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1552368054, "label": "rewrite_sql hook"}, "performed_via_github_app": null}