{"html_url": "https://github.com/simonw/datasette/issues/1668#issuecomment-1073136896", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1668", "id": 1073136896, "node_id": "IC_kwDOBm6k_c4_9sUA", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-20T00:33:23Z", "updated_at": "2022-03-20T00:33:23Z", "author_association": "OWNER", "body": "I'm going to release this as a 0.61 alpha so I can more easily depend on it from `datasette-hashed-urls`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1174306154, "label": "Introduce concept of a database `route`, separate from its name"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1668#issuecomment-1073136686", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1668", "id": 1073136686, "node_id": "IC_kwDOBm6k_c4_9sQu", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-20T00:31:13Z", "updated_at": "2022-03-20T00:31:13Z", "author_association": "OWNER", "body": "That demo is now live:\r\n\r\n- https://latest.datasette.io/alternative-route\r\n- https://latest.datasette.io/alternative-route/attraction_characteristic", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1174306154, "label": "Introduce concept of a database `route`, separate from its name"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1668#issuecomment-1073135433", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1668", "id": 1073135433, "node_id": "IC_kwDOBm6k_c4_9r9J", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-20T00:20:36Z", "updated_at": "2022-03-20T00:20:36Z", "author_association": "OWNER", "body": "Building this plugin instantly revealed that all of the links - on the homepage and the database page and so on - are incorrect:\r\n```python\r\nfrom datasette import hookimpl\r\n\r\n@hookimpl\r\ndef startup(datasette):\r\n db = datasette.get_database(\"fixtures2\")\r\n db.route = \"alternative-route\"\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1174306154, "label": "Introduce concept of a database `route`, separate from its name"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1668#issuecomment-1073134816", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1668", "id": 1073134816, "node_id": "IC_kwDOBm6k_c4_9rzg", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-20T00:16:22Z", "updated_at": "2022-03-20T00:16:22Z", "author_association": "OWNER", "body": "I'm going to add a `fixtures2.db` database which has that as the name but `alternative-route` as the route. I'll set that up using a custom plugin in the `plugins/` folder that gets deployed by https://github.com/simonw/datasette/blob/main/.github/workflows/deploy-latest.yml", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1174306154, "label": "Introduce concept of a database `route`, separate from its name"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1668#issuecomment-1073134206", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1668", "id": 1073134206, "node_id": "IC_kwDOBm6k_c4_9rp-", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-20T00:12:03Z", "updated_at": "2022-03-20T00:12:03Z", "author_association": "OWNER", "body": "I'd like to have a live demo of this up on `latest.datasette.io` too.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1174306154, "label": "Introduce concept of a database `route`, separate from its name"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1668#issuecomment-1073126264", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1668", "id": 1073126264, "node_id": "IC_kwDOBm6k_c4_9pt4", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T22:59:30Z", "updated_at": "2022-03-19T22:59:30Z", "author_association": "OWNER", "body": "Also need to update the `datasette.urls` methods that construct the URL to a database/table/row - they take the database name but they need to know to look for the route.\r\n\r\nNeed to add tests that check the links in the HTML and can confirm this is working correctly.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1174306154, "label": "Introduce concept of a database `route`, separate from its name"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1668#issuecomment-1073125334", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1668", "id": 1073125334, "node_id": "IC_kwDOBm6k_c4_9pfW", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T22:53:55Z", "updated_at": "2022-03-19T22:53:55Z", "author_association": "OWNER", "body": "Need to update documentation in a few places - e.g. https://docs.datasette.io/en/stable/internals.html#remove-database-name\r\n\r\n> This removes a database that has been previously added. `name=` is the unique name of that database, used in its URL path.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1174306154, "label": "Introduce concept of a database `route`, separate from its name"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1668#issuecomment-1073112104", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1668", "id": 1073112104, "node_id": "IC_kwDOBm6k_c4_9mQo", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T21:08:21Z", "updated_at": "2022-03-19T21:08:21Z", "author_association": "OWNER", "body": "I think I've got this working but I need to write a test for it that covers the rare case when the route is not the same thing as the database name.\r\n\r\nI'll do that with a new test.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1174306154, "label": "Introduce concept of a database `route`, separate from its name"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1668#issuecomment-1073097394", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1668", "id": 1073097394, "node_id": "IC_kwDOBm6k_c4_9iqy", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T20:56:35Z", "updated_at": "2022-03-19T20:56:35Z", "author_association": "OWNER", "body": "I'm trying to think if there's any reason not to use `route` for this. Would I possibly want to use that noun for something else in the future? I like it more than `route_path` because it has no underscore.\r\n\r\nDecision made: I'm going with `route`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1174306154, "label": "Introduce concept of a database `route`, separate from its name"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1668#issuecomment-1073076187", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1668", "id": 1073076187, "node_id": "IC_kwDOBm6k_c4_9dfb", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T20:28:20Z", "updated_at": "2022-03-19T20:28:20Z", "author_association": "OWNER", "body": "I'm going to keep `path` as the path to the file on disk. I'll pick a new name for what is currently `path` in that undocumented JSON API.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1174306154, "label": "Introduce concept of a database `route`, separate from its name"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1668#issuecomment-1073076136", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1668", "id": 1073076136, "node_id": "IC_kwDOBm6k_c4_9deo", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T20:27:44Z", "updated_at": "2022-03-19T20:27:44Z", "author_association": "OWNER", "body": "Pretty sure changing it will break some existing plugins though, including likely Datasette Desktop.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1174306154, "label": "Introduce concept of a database `route`, separate from its name"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1668#issuecomment-1073076110", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1668", "id": 1073076110, "node_id": "IC_kwDOBm6k_c4_9deO", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T20:27:22Z", "updated_at": "2022-03-19T20:27:22Z", "author_association": "OWNER", "body": "The docs do currently describe `path` as the filesystem path here: https://docs.datasette.io/en/stable/internals.html#database-class\r\n\r\n\"image\"\r\n\r\nGood thing I'm not at 1.0 yet so I can change that!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1174306154, "label": "Introduce concept of a database `route`, separate from its name"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1668#issuecomment-1073076015", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1668", "id": 1073076015, "node_id": "IC_kwDOBm6k_c4_9dcv", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T20:26:32Z", "updated_at": "2022-03-19T20:26:32Z", "author_association": "OWNER", "body": "I'm inclined to redefine `ds.path` to `ds.file_path` to fix this. Or `ds.filepath`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1174306154, "label": "Introduce concept of a database `route`, separate from its name"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1668#issuecomment-1073075913", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1668", "id": 1073075913, "node_id": "IC_kwDOBm6k_c4_9dbJ", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T20:25:46Z", "updated_at": "2022-03-19T20:26:08Z", "author_association": "OWNER", "body": "The output of `/.json` DOES use `path` to mean the URL path, not the path to the file on disk:\r\n\r\n```\r\n{\r\n \"fixtures.dot\": {\r\n \"name\": \"fixtures.dot\",\r\n \"hash\": null,\r\n \"color\": \"631f11\",\r\n \"path\": \"/fixtures~2Edot\",\r\n```\r\nSo that's a problem already: having `db.path` refer to something different from that JSON is inconsistent.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1174306154, "label": "Introduce concept of a database `route`, separate from its name"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1668#issuecomment-1073075697", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1668", "id": 1073075697, "node_id": "IC_kwDOBm6k_c4_9dXx", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T20:24:06Z", "updated_at": "2022-03-19T20:24:06Z", "author_association": "OWNER", "body": "Right now if a database has a `.` in its name e.g. `fixtures.dot` the URL to that database is:\r\n\r\n /fixtures~2Edot\r\n\r\nBut the output on `/-/databases` doesn't reflect that, it still shows the name with the dot.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1174306154, "label": "Introduce concept of a database `route`, separate from its name"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1668#issuecomment-1073073579", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1668", "id": 1073073579, "node_id": "IC_kwDOBm6k_c4_9c2r", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T20:06:27Z", "updated_at": "2022-03-19T20:06:27Z", "author_association": "OWNER", "body": "Marking this as blocked until #1660 is done.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1174306154, "label": "Introduce concept of a database `route`, separate from its name"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1668#issuecomment-1073073547", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1668", "id": 1073073547, "node_id": "IC_kwDOBm6k_c4_9c2L", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T20:06:07Z", "updated_at": "2022-03-19T20:06:07Z", "author_association": "OWNER", "body": "Implementing this is a little tricky because there's a whole lot of code that expects the `database` captured by the URL routing to be the name used to look up the database in `datasette.databases` - or via `.get_database()`.\r\n\r\nThe `DataView.get()` method is a good example of the trickyness here. It even has code that dispatches out to plugin hooks that take `database` as a parameter.\r\n\r\nhttps://github.com/simonw/datasette/blob/61419388c134001118aaf7dfb913562d467d7913/datasette/views/base.py#L383-L555\r\n\r\nAll the more reason to get rid of that `BaseView -> DataView -> TableView` hierarchy entirely:\r\n- #1660", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1174306154, "label": "Introduce concept of a database `route`, separate from its name"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1668#issuecomment-1073043433", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1668", "id": 1073043433, "node_id": "IC_kwDOBm6k_c4_9Vfp", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T16:54:55Z", "updated_at": "2022-03-19T20:01:19Z", "author_association": "OWNER", "body": "Options:\r\n- `route_path`\r\n- `url_path`\r\n- `route`\r\n\r\nI like `route_path`, or maybe `route`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1174306154, "label": "Introduce concept of a database `route`, separate from its name"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1668#issuecomment-1073043713", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1668", "id": 1073043713, "node_id": "IC_kwDOBm6k_c4_9VkB", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T16:56:19Z", "updated_at": "2022-03-19T16:56:19Z", "author_association": "OWNER", "body": "Worth noting that the `name` right now is picked automatically to avoid conflicts:\r\n\r\nhttps://github.com/simonw/datasette/blob/61419388c134001118aaf7dfb913562d467d7913/datasette/app.py#L397-L413", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1174306154, "label": "Introduce concept of a database `route`, separate from its name"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1668#issuecomment-1073043350", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1668", "id": 1073043350, "node_id": "IC_kwDOBm6k_c4_9VeW", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T16:54:26Z", "updated_at": "2022-03-19T16:54:26Z", "author_association": "OWNER", "body": "The `Database` class already has a `path` property but it means something else - it's the path to the `.db` file on disk:\r\n\r\nhttps://github.com/simonw/datasette/blob/61419388c134001118aaf7dfb913562d467d7913/datasette/database.py#L29-L50\r\n\r\nSo need a different name for the path-that-is-used-in-the-URL.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1174306154, "label": "Introduce concept of a database `route`, separate from its name"}, "performed_via_github_app": null}