{"html_url": "https://github.com/simonw/datasette/issues/1518#issuecomment-991285527", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1518", "id": 991285527, "node_id": "IC_kwDOBm6k_c47FdEX", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-12-10T20:52:00Z", "updated_at": "2021-12-10T20:52:00Z", "author_association": "OWNER", "body": "If I break this up into `@inject` methods, what methods could I have and what would they do?\r\n\r\n- `resolve_path`: Use request path to resolve the database and table. Could handle hash URLs too (if I don't manage to extract those to a plugin) - would be nice if this could raise a redirect, but I think that will instead have to be one of the things it returns\r\n- `build_sql`: Builds the SQL query based on the querystring (and some DB introspection)\r\n- `execute_count`: Execute the `count(*)`\r\n- `execute_rows`: Execute the `limit 101` to fetch the rows\r\n- `execute_facets`: Execute all requested facets (could this do its own `asyncio.gather()` to run facets in parallel?)\r\n- `suggest_facets`: Execute facet suggestions\r\n\r\nAre there any plugin hooks that would make sense to execute in parallel? Actually there might be: I don't think `extra_template_vars`, `extra_css_urls`, `extra_js_urls`, `extra_body_script` depend on each other so it might be possible to execute them in a parallel chunk (at least any of them that return awaitables).", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1058072543, "label": "Complete refactor of TableView and table.html template"}, "performed_via_github_app": null}