{"html_url": "https://github.com/simonw/datasette/issues/1988#issuecomment-1379502161", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1988", "id": 1379502161, "node_id": "IC_kwDOBm6k_c5SOYhR", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-01-11T21:24:24Z", "updated_at": "2023-01-11T21:25:05Z", "author_association": "OWNER", "body": "Renaming `sql()` to `template_sql()` in https://github.com/simonw/datasette-template-sql and shipping a 2.0 release of that plugin (it is currently at 1.0.2) would be a sensible short-term fix too.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1529707837, "label": "Reconsider pattern where plugins could break existing template context"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1988#issuecomment-1379500131", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1988", "id": 1379500131, "node_id": "IC_kwDOBm6k_c5SOYBj", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-01-11T21:22:31Z", "updated_at": "2023-01-11T21:22:31Z", "author_association": "OWNER", "body": "Relevant code:\r\n\r\nhttps://github.com/simonw/datasette/blob/6a352e99ab988dbf8fd22a100049caa6ad33f1ec/datasette/app.py#L1138-L1149\r\n\r\nhttps://github.com/simonw/datasette/blob/6a352e99ab988dbf8fd22a100049caa6ad33f1ec/datasette/app.py#L1193-L1195", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1529707837, "label": "Reconsider pattern where plugins could break existing template context"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1988#issuecomment-1379495504", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1988", "id": 1379495504, "node_id": "IC_kwDOBm6k_c5SOW5Q", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-01-11T21:18:00Z", "updated_at": "2023-01-11T21:18:25Z", "author_association": "OWNER", "body": "A few options:\r\n- Ensure that the explicit template context overrides anything that plugins might do - so in this case the `sql(...)` function would not be available on that page. This would break people who have custom templates that use that function though.\r\n- Encourage naming conventions where functions and variables from plugins are less likely to interfere with existing functionality.\r\n- Completely change how templates work, so you never have a variable called `{{ sql }}` - it is always accessed via some parent object instead, such as `{{ page.sql }}`.\r\n\r\nThat last option actually fits quite well with my efforts to unify template rendering with JSON (and JSON extras) so it might be the best way to address this.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1529707837, "label": "Reconsider pattern where plugins could break existing template context"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1988#issuecomment-1379492499", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1988", "id": 1379492499, "node_id": "IC_kwDOBm6k_c5SOWKT", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-01-11T21:15:01Z", "updated_at": "2023-01-11T21:20:14Z", "author_association": "OWNER", "body": "This is tricky. `datasette-template-sql` registers a custom `sql()` function, but @cldellow spotted a situation where this would interfere with an existing `{{ sql }}` variable in a template context!\r\n\r\nhttps://github.com/simonw/datasette-template-sql/blob/70483fd94bb0349761830e37c9ab928e8966841a/datasette_template_sql/__init__.py\r\n\r\n```python\r\n@hookimpl\r\ndef extra_template_vars(datasette):\r\n async def execute_sql(sql, args=None, database=None):\r\n db = datasette.get_database(database)\r\n return (await db.execute(sql, args)).rows\r\n\r\n return {\"sql\": execute_sql}\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1529707837, "label": "Reconsider pattern where plugins could break existing template context"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1987#issuecomment-1379313564", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1987", "id": 1379313564, "node_id": "IC_kwDOBm6k_c5SNqec", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-01-11T18:29:25Z", "updated_at": "2023-01-11T18:29:25Z", "author_association": "OWNER", "body": "Fixed:\r\n- https://docs.datasette.io/en/latest/installation.html#using-pip\r\n- https://docs.datasette.io/en/stable/installation.html#using-pip\r\n- https://docs.datasette.io/en/0.64.1/installation.html#using-pip", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1529452371, "label": "installpython3.com is now a spam website"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1987#issuecomment-1379311498", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1987", "id": 1379311498, "node_id": "IC_kwDOBm6k_c5SNp-K", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-01-11T18:27:30Z", "updated_at": "2023-01-11T18:27:46Z", "author_association": "OWNER", "body": "I'm going to leave the bad link in the old versions, because I can't figure out a way to update them using ReadTheDocs - shipping 0.64.1 will at least mean that both `/latest/` and `/stable/` have a good link.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1529452371, "label": "installpython3.com is now a spam website"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1987#issuecomment-1379282756", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1987", "id": 1379282756, "node_id": "IC_kwDOBm6k_c5SNi9E", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-01-11T18:04:22Z", "updated_at": "2023-01-11T18:04:22Z", "author_association": "OWNER", "body": "That change is now live on https://docs.datasette.io/en/latest/installation.html#using-pip\r\n\r\nI may need to ship a new stable dot-release to update the `/en/stable/` page though.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1529452371, "label": "installpython3.com is now a spam website"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1987#issuecomment-1379276484", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1987", "id": 1379276484, "node_id": "IC_kwDOBm6k_c5SNhbE", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-01-11T18:00:35Z", "updated_at": "2023-01-11T18:00:35Z", "author_association": "OWNER", "body": "Next challenge: how to best deploy this.\r\n\r\nIdeally I'd like to fix all of the older versions of the docs too - pages like https://docs.datasette.io/en/0.59.4/installation.html#using-pip\r\n\r\nNot sure if ReadTheDocs has a mechanism for that.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1529452371, "label": "installpython3.com is now a spam website"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1985#issuecomment-1378253346", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1985", "id": 1378253346, "node_id": "IC_kwDOBm6k_c5SJnoi", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-01-11T05:18:05Z", "updated_at": "2023-01-11T05:18:05Z", "author_association": "OWNER", "body": "`Datasette(path)` should either work or it should return an easily debugged error message.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1528448642, "label": "Don't let Datasette(path) without a list cause weird errors"}, "performed_via_github_app": null}