{"html_url": "https://github.com/simonw/datasette/issues/1896#issuecomment-1320616559", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1896", "id": 1320616559, "node_id": "IC_kwDOBm6k_c5OtwJv", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-18T22:51:14Z", "updated_at": "2022-11-18T22:51:14Z", "author_association": "OWNER", "body": "New methods are documented here: https://docs.datasette.io/en/1.0-dev/internals.html#resolve-database-request", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1452364777, "label": "Extract logic for resolving a URL to a database / table / row"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1896#issuecomment-1320588299", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1896", "id": 1320588299, "node_id": "IC_kwDOBm6k_c5OtpQL", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-18T22:16:59Z", "updated_at": "2022-11-18T22:17:06Z", "author_association": "OWNER", "body": "Found myself needing an `await db.view_exists()` method for this, similar to the existing `await db.table_exists()` one.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1452364777, "label": "Extract logic for resolving a URL to a database / table / row"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1896#issuecomment-1317757949", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1896", "id": 1317757949, "node_id": "IC_kwDOBm6k_c5Oi2P9", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-16T22:27:47Z", "updated_at": "2022-11-18T21:48:29Z", "author_association": "OWNER", "body": "Open question: should `resolve_table()` know how to identify named canned queries too?\r\n\r\nI think not, at least for the moment. Feels a bit too specialist to expose in a documented API.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1452364777, "label": "Extract logic for resolving a URL to a database / table / row"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1896#issuecomment-1317757112", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1896", "id": 1317757112, "node_id": "IC_kwDOBm6k_c5Oi2C4", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-16T22:26:52Z", "updated_at": "2022-11-16T22:33:13Z", "author_association": "OWNER", "body": "Some ideas from walking the dog:\r\n\r\nChallenge: standard URL routing of request to database/table/row\r\n\r\nStandardize on the named components of the URL patterns - `database`, `table`, `pks`\r\n\r\nAsync function that takes the request and the Datasette instance and returns a Resolved instance with:\r\n```\r\n.level - database or table or row (better name?)\r\n.database - the name of the database\r\n.db - the database object\r\n.table - the name of the table (or view)\r\n.is_view perhaps?\r\n.pk_values if it's a row\r\n```\r\nShould this attempt to resolve names queries too?\r\n```\r\n.where_sql - the where fragment you use\r\n.where_params - accompanying dictionary\r\n\r\nawait datasette.resolve_request(request)\r\n```\r\nOr even better three methods: \r\n```python\r\ndatasette.resolve_database(request)\r\ndatasette.resolve_table(request)\r\ndatasette.resolve_row(request)\r\n```\r\nThese can be typed correctly\r\n\r\nMethods raise `NotFound` if not found", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1452364777, "label": "Extract logic for resolving a URL to a database / table / row"}, "performed_via_github_app": null}