{"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} {"html_url": "https://github.com/simonw/datasette/pull/2080#issuecomment-1563629348", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2080", "id": 1563629348, "node_id": "IC_kwDOBm6k_c5dMxck", "user": {"value": 22429695, "label": "codecov[bot]"}, "created_at": "2023-05-25T23:31:10Z", "updated_at": "2023-05-26T00:07:34Z", "author_association": "NONE", "body": "## [Codecov](https://app.codecov.io/gh/simonw/datasette/pull/2080?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) Report\nPatch coverage: **`95.45`**% and project coverage change: **`+0.01`** :tada:\n> Comparison is base [(`b49fa44`)](https://app.codecov.io/gh/simonw/datasette/commit/b49fa446d683ddcaf6faf2944dacc0d866bf2d70?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) 92.40% compared to head [(`df5fd73`)](https://app.codecov.io/gh/simonw/datasette/pull/2080?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) 92.41%.\n\n> :exclamation: Current head df5fd73 differs from pull request most recent head e990fbc. Consider uploading reports for the commit e990fbc to get more accurate results\n\n
Additional details and impacted files\n\n\n```diff\n@@ Coverage Diff @@\n## main #2080 +/- ##\n==========================================\n+ Coverage 92.40% 92.41% +0.01% \n==========================================\n Files 39 39 \n Lines 5768 5790 +22 \n==========================================\n+ Hits 5330 5351 +21 \n- Misses 438 439 +1 \n```\n\n\n| [Impacted Files](https://app.codecov.io/gh/simonw/datasette/pull/2080?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) | Coverage \u0394 | |\n|---|---|---|\n| [datasette/views/base.py](https://app.codecov.io/gh/simonw/datasette/pull/2080?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison#diff-ZGF0YXNldHRlL3ZpZXdzL2Jhc2UucHk=) | `92.97% <95.45%> (+0.18%)` | :arrow_up: |\n\n\n
\n\n[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/simonw/datasette/pull/2080?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison). \n:loudspeaker: Do you have feedback about the report comment? [Let us know in this issue](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison).\n", "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}