{"html_url": "https://github.com/simonw/datasette/pull/2080#issuecomment-1563650990", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2080", "id": 1563650990, "node_id": "IC_kwDOBm6k_c5dM2uu", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-26T00:08:59Z", "updated_at": "2023-05-26T00:08:59Z", "author_association": "OWNER", "body": "I'm not going to document this yet, I want to let it bake for a bit longer first.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1726603778, "label": "New View base class"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/2053#issuecomment-1563663616", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2053", "id": 1563663616, "node_id": "IC_kwDOBm6k_c5dM50A", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-26T00:32:08Z", "updated_at": "2023-05-26T00:32:08Z", "author_association": "OWNER", "body": "Now that I have the new `View` subclass from #2078 I want to use it to simplify this code.\r\n\r\nChallenge: there are several things to consider here:\r\n\r\n- The `/db` page without `?sql=` displays a list of tables in that database\r\n- With `?sql=` it shows the query results for that query (or an error)\r\n- If it's a `/db/name-of-canned-query` it works a bit like the query page, but executes a canned query instead of the `?sql=` query\r\n- POST `/db/name-of-canned-query` is support for writable canned queries", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1656432059, "label": "WIP new JSON for queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/2053#issuecomment-1563663925", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2053", "id": 1563663925, "node_id": "IC_kwDOBm6k_c5dM541", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-26T00:32:47Z", "updated_at": "2023-05-26T00:35:47Z", "author_association": "OWNER", "body": "I'm going to entirely split canned queries off from `?sql=` queries - they share a bunch of code right now which is just making everything much harder to follow.\r\n\r\nI'll refactor their shared bits into functions that they both call.\r\n\r\nOr _maybe_ I'll try having `CannedQueryView` as a subclass of `QueryView`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1656432059, "label": "WIP new JSON for queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/2053#issuecomment-1563667574", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2053", "id": 1563667574, "node_id": "IC_kwDOBm6k_c5dM6x2", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-26T00:40:22Z", "updated_at": "2023-05-26T00:40:22Z", "author_association": "OWNER", "body": "Or maybe...\r\n\r\n- `BaseQueryView(View)` - knows how to render the results of a SQL query\r\n- `QueryView(BaseQueryView)` - renders from `?sql=`\r\n- `CannedQueryView(BaseQueryView)` - renders for a named canned query\r\n\r\nAnd then later perhaps:\r\n\r\n- `RowQueryView(BaseQueryView)` - renders the `select * from t where pk = ?`\r\n- `TableQueryView(BaseQueryView)` - replaces the super complex existing `TableView`", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1656432059, "label": "WIP new JSON for queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/2053#issuecomment-1563793781", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2053", "id": 1563793781, "node_id": "IC_kwDOBm6k_c5dNZl1", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-26T04:27:55Z", "updated_at": "2023-05-26T04:27:55Z", "author_association": "OWNER", "body": "I should split out a `canned_query.html` template too, as something that extends the `query.html` template.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1656432059, "label": "WIP new JSON for queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/2053#issuecomment-1565058994", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2053", "id": 1565058994, "node_id": "IC_kwDOBm6k_c5dSOey", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-05-26T23:13:02Z", "updated_at": "2023-05-26T23:13:02Z", "author_association": "OWNER", "body": "I should have an extra called `extra_html_context` which bundles together all of the weird extra stuff needed by the HTML template, and is then passed as the root context when the template is rendered (with the other stuff from extras patched into it).", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1656432059, "label": "WIP new JSON for queries"}, "performed_via_github_app": null}