{"html_url": "https://github.com/simonw/datasette/pull/1664#issuecomment-1072890524", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1664", "id": 1072890524, "node_id": "IC_kwDOBm6k_c4_8wKc", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-18T23:44:33Z", "updated_at": "2022-03-19T00:06:51Z", "author_association": "OWNER", "body": "Looks like that was set here: https://github.com/simonw/datasette/blob/77a904fea14f743560af9cc668146339bdbbd0a9/datasette/views/base.py#L490-L492", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1173017980, "label": "Remove hashed URL mode"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1664#issuecomment-1072898797", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1664", "id": 1072898797, "node_id": "IC_kwDOBm6k_c4_8yLt", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T00:11:09Z", "updated_at": "2022-03-19T00:11:09Z", "author_association": "OWNER", "body": "Still need to remove it from the documentation and do something about that `hash_urls` setting.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1173017980, "label": "Remove hashed URL mode"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1664#issuecomment-1072898923", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1664", "id": 1072898923, "node_id": "IC_kwDOBm6k_c4_8yNr", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T00:11:33Z", "updated_at": "2022-03-19T00:11:33Z", "author_association": "OWNER", "body": "I'm going to land this and handle those in separate commits.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1173017980, "label": "Remove hashed URL mode"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1661#issuecomment-1072901159", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1661", "id": 1072901159, "node_id": "IC_kwDOBm6k_c4_8ywn", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T00:20:27Z", "updated_at": "2022-03-19T00:20:27Z", "author_association": "OWNER", "body": "I can remove the `default_cache_ttl_hashed` setting too.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1170355774, "label": "Remove Hashed URL mode"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1661#issuecomment-1072904703", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1661", "id": 1072904703, "node_id": "IC_kwDOBm6k_c4_8zn_", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T00:37:36Z", "updated_at": "2022-03-19T00:37:36Z", "author_association": "OWNER", "body": "Updated docs: https://docs.datasette.io/en/latest/performance.html#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": 1170355774, "label": "Remove Hashed URL mode"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1662#issuecomment-1072905467", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1662", "id": 1072905467, "node_id": "IC_kwDOBm6k_c4_8zz7", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T00:42:23Z", "updated_at": "2022-03-19T00:42:23Z", "author_association": "OWNER", "body": "Those client-side SQLite tricks are _really_ neat.\r\n\r\n`datasette publish` defaults to configuring it so the raw SQLite database can be downloaded from `/fixtures.db` - and this issue updated it to be served with a CORS header that would allow client-side scripts to load the file:\r\n\r\n- #1057\r\n\r\nIf you're not going to run any server-side code at all you don't need Datasette for this - you can upload the SQLite database file to any static hosting with CORS headers and load it into the client that way.\r\n\r\nIn terms of static publishing, I do think there's something interesting about using Datasette to generate static sites. There's an issue discussing options for that over here:\r\n\r\n- #1605", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1170497629, "label": "[feature request] Publish to fully static website"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1605#issuecomment-1072907200", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1605", "id": 1072907200, "node_id": "IC_kwDOBm6k_c4_80PA", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T00:52:54Z", "updated_at": "2022-03-19T00:53:45Z", "author_association": "OWNER", "body": "Had a thought about the implementation of this: it could make a really neat plugin.\r\n\r\nSomething like `datasette-export` which adds a `export` command using https://docs.datasette.io/en/stable/plugin_hooks.html#register-commands-cli - then you could run:\r\n\r\n datasette export my-export-dir mydatabase.db -m metadata.json --template-dir templates/\r\n\r\nAnd the command would then:\r\n\r\n- Create a `Datasette()` instance with those databases/metadata/etc\r\n- Execute`await datasette.client.get(\"/\")` to get the homepage HTML\r\n- Parse the HTML using BeautifulSoup to find all `a[href]`, `link[href]`, `script[src]`, `img[src]` elements that reference a relative path as opposed to one that starts with `http://`\r\n- Write out the homepage to `my-export-dir/index.html`\r\n- Recursively fetch and dump all of the other pages and assets that it found too\r\n\r\nAll of that HTML parsing may be over-complicating things. It could alternatively accept options for which pages you want to export:\r\n\r\n```\r\ndatasette export my-export-dir \\\r\n mydatabase.db -m metadata.json --template-dir templates/ \\\r\n --path / \\\r\n --path /mydatabase ...\r\n```\r\n\r\nOr a really wild option: it could allow you to define the paths you want to export using a SQL query:\r\n\r\n```\r\ndatasette export my-export-dir \\\r\n mydatabase.db -m metadata.json --template-dir templates/ \\\r\n --sql \"\r\nselect '/' as path, 'index.html' as filename\r\n union all\r\nselect '/mydatabase/articles/' || id as path, 'article-' || id || '.html' as filename\r\nfrom articles\r\n union all\r\nselect '/mydatabase/tags/' || tag as path, 'tag-' || tag || '.html' as filename\r\nfrom tags\r\n\"\r\n```\r\nWhich would save these files:\r\n- `index.html` as the content of `/`\r\n- `article-1.html` (and more) as the content of `/mydatabase/articles/1`\r\n- `tag-python.html` (and more) as the content of `/mydatabase/tags/python`", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1108671952, "label": "Scripted exports"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1228#issuecomment-1072907610", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1228", "id": 1072907610, "node_id": "IC_kwDOBm6k_c4_80Va", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T00:55:29Z", "updated_at": "2022-03-19T00:55:29Z", "author_association": "OWNER", "body": "It looks to me like something is causing the faceting query here to return a string when it was expected to return a number:\r\n\r\nhttps://github.com/simonw/datasette/blob/32963018e7edfab1233de7c7076c428d0e5c7813/datasette/facets.py#L153-L170\r\n\r\nI can't think of any way that a `count(*) as n` would turn into a string though!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 810397025, "label": "500 error caused by faceting if a column called `n` exists"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1228#issuecomment-1072907680", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1228", "id": 1072907680, "node_id": "IC_kwDOBm6k_c4_80Wg", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T00:55:48Z", "updated_at": "2022-03-19T00:55:48Z", "author_association": "OWNER", "body": "... unless your data had a column called `n`?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 810397025, "label": "500 error caused by faceting if a column called `n` exists"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1228#issuecomment-1072908029", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1228", "id": 1072908029, "node_id": "IC_kwDOBm6k_c4_80b9", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T00:57:54Z", "updated_at": "2022-03-19T00:57:54Z", "author_association": "OWNER", "body": "Yes! That's the problem. I was able to replicate it like so:\r\n```\r\necho '[{ \r\n \"n\": \"one\",\r\n \"abc\": 1\r\n}, {\r\n \"n\": \"one\",\r\n \"abc\": 2\r\n}, {\r\n \"n\": \"two\",\r\n \"abc\": 3\r\n}]' | sqlite-utils insert column-called-n.db t -\r\n```\r\n\"image\"\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 810397025, "label": "500 error caused by faceting if a column called `n` exists"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1228#issuecomment-1072915936", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1228", "id": 1072915936, "node_id": "IC_kwDOBm6k_c4_82Xg", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T01:50:27Z", "updated_at": "2022-03-19T01:50:27Z", "author_association": "OWNER", "body": "Demo: https://latest.datasette.io/fixtures/facetable - which now has a column called `n`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 810397025, "label": "500 error caused by faceting if a column called `n` exists"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1666#issuecomment-1072933875", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1666", "id": 1072933875, "node_id": "IC_kwDOBm6k_c4_86vz", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T04:03:42Z", "updated_at": "2022-03-19T04:03:42Z", "author_association": "OWNER", "body": "Tests so far: https://github.com/simonw/datasette/blob/711767bcd3c1e76a0861fe7f24069ff1c8efc97a/tests/test_routes.py#L12-L34", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1174162781, "label": "Refactor URL routing to enable testing"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1561#issuecomment-1072939780", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1561", "id": 1072939780, "node_id": "IC_kwDOBm6k_c4_88ME", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T04:45:40Z", "updated_at": "2022-03-19T04:45:40Z", "author_association": "OWNER", "body": "I ended up moving hashed URL mode out to a plugin in:\r\n- #647\r\n\r\nIf you're still interested in using it with `_memory` please open an issue in that repo here: https://github.com/simonw/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": 1082765654, "label": "add hash id to \"_memory\" url if hashed url mode is turned on and crossdb is also turned on"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1228#issuecomment-1072954795", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1228", "id": 1072954795, "node_id": "IC_kwDOBm6k_c4_8_2r", "user": {"value": 7107523, "label": "Kabouik"}, "created_at": "2022-03-19T06:44:40Z", "updated_at": "2022-03-19T06:44:40Z", "author_association": "NONE", "body": "> ... unless your data had a column called `n`?\r\n\r\nExactly, that's highly likely even though I can't double check from this computer just now. Thanks!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 810397025, "label": "500 error caused by faceting if a column called `n` exists"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/878#issuecomment-1073037939", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/878", "id": 1073037939, "node_id": "IC_kwDOBm6k_c4_9UJz", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T16:19:30Z", "updated_at": "2022-03-19T16:19:30Z", "author_association": "OWNER", "body": "On revisiting https://gist.github.com/simonw/281eac9c73b062c3469607ad86470eb2 a few months later I'm having second thoughts about using `@inject` on the `main()` method.\r\n\r\nBut I still like the pattern as a way to resolve more complex cases like \"to generate GeoJSON of the expanded view with labels, the label expansion code needs to run once at some before the GeoJSON formatting code does\".\r\n\r\nSo I'm going to stick with it a tiny bit longer, but maybe try to make it a lot more explicit when it's going to happen rather than having the main view methods themselves also use async DI.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 648435885, "label": "New pattern for views that return either JSON or HTML, available for plugins"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1666#issuecomment-1073039241", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1666", "id": 1073039241, "node_id": "IC_kwDOBm6k_c4_9UeJ", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T16:28:15Z", "updated_at": "2022-03-19T16:28:15Z", "author_association": "OWNER", "body": "This is more interesting if it also asserts against the captured matches from the pattern.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1174162781, "label": "Refactor URL routing to enable testing"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1666#issuecomment-1073039670", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1666", "id": 1073039670, "node_id": "IC_kwDOBm6k_c4_9Uk2", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T16:31:08Z", "updated_at": "2022-03-19T16:31:57Z", "author_association": "OWNER", "body": "This does make it more interesting - it also highlights how inconsistent the way the capturing works is. Especially `as_format` which can be `None` or `\"\"` or `.json` or `json` or not used at all in the case of `TableView`.\r\n\r\nhttps://github.com/simonw/datasette/blob/764738dfcb16cd98b0987d443f59d5baa9d3c332/tests/test_routes.py#L12-L36", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1174162781, "label": "Refactor URL routing to enable testing"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1667#issuecomment-1073040072", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1667", "id": 1073040072, "node_id": "IC_kwDOBm6k_c4_9UrI", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T16:34:02Z", "updated_at": "2022-03-19T16:34:02Z", "author_association": "OWNER", "body": "I called it `as_format` to avoid clashing with the Python built-in `format()` function when these things were turned into keyword arguments, but now that they're not I can use `format` instead.\r\n\r\nI think I'm going to go with `database`, `table`, `format` and `pks`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1174302994, "label": "Make route matched pattern groups more consistent"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1667#issuecomment-1073042554", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1667", "id": 1073042554, "node_id": "IC_kwDOBm6k_c4_9VR6", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T16:50:01Z", "updated_at": "2022-03-19T16:52:35Z", "author_association": "OWNER", "body": "OK, I've made this more consistent - I still need to address the fact that `format` can be `.json` or `json` or not used at all before I close this issue.\r\n\r\nhttps://github.com/simonw/datasette/blob/61419388c134001118aaf7dfb913562d467d7913/tests/test_routes.py#L15-L35", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1174302994, "label": "Make route matched pattern groups more consistent"}, "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} {"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-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-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/1660#issuecomment-1073073599", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1660", "id": 1073073599, "node_id": "IC_kwDOBm6k_c4_9c2_", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T20:06:40Z", "updated_at": "2022-03-19T20:06:40Z", "author_association": "OWNER", "body": "This blocks:\r\n- #1668", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1170144879, "label": "Refactor and simplify Datasette routing and views"}, "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-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-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-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-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-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/1667#issuecomment-1073076624", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1667", "id": 1073076624, "node_id": "IC_kwDOBm6k_c4_9dmQ", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T20:31:44Z", "updated_at": "2022-03-19T20:31:44Z", "author_association": "OWNER", "body": "I can now read `format` from `request.url_vars` and delete this code entirely: https://github.com/simonw/datasette/blob/b9c2b1cfc8692b9700416db98721fa3ec982f6be/datasette/views/base.py#L375-L381", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1174302994, "label": "Make route matched pattern groups more consistent"}, "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-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/dogsheep/healthkit-to-sqlite/issues/14#issuecomment-1073123231", "issue_url": "https://api.github.com/repos/dogsheep/healthkit-to-sqlite/issues/14", "id": 1073123231, "node_id": "IC_kwDOC8tyDs4_9o-f", "user": {"value": 343884, "label": "lchski"}, "created_at": "2022-03-19T22:39:29Z", "updated_at": "2022-03-19T22:39:29Z", "author_association": "NONE", "body": "I have this issue, too, with a fresh export. None of my `Workout` entries in `export.xml` have an `id` key, though [the sample `export.xml` in the tests folder doesn\u2019t either](https://github.com/dogsheep/healthkit-to-sqlite/blob/main/tests/zip_contents/apple_health_export/export.xml#L14-L21), so I don\u2019t think this is the culprit. Indeed, it seems @simonw is using the [`hash_id` function from `sqlite_utils`](https://sqlite-utils.datasette.io/en/stable/python-api.html#setting-an-id-based-on-the-hash-of-the-row-contents), which creates a column (`id`, in this case) based on a hash of the row\u2019s contents.\r\n\r\nWhen I run the script, a `workouts` table is created, with one entry: my first workout. No `workout_points` table is created, as [I\u2019d expect from `utils.py`](https://github.com/dogsheep/healthkit-to-sqlite/blob/main/healthkit_to_sqlite/utils.py#L89-L90). I then get essentially the same error as noted in this thread:\r\n\r\n```Importing from HealthKit [###################################-] 98% 00:00:01\r\nTraceback (most recent call last):\r\n File \"/Users/lchski/.pyenv/versions/3.10.3/bin/healthkit-to-sqlite\", line 8, in \r\n sys.exit(cli())\r\n File \"/Users/lchski/.pyenv/versions/3.10.3/lib/python3.10/site-packages/click/core.py\", line 1128, in __call__\r\n return self.main(*args, **kwargs)\r\n File \"/Users/lchski/.pyenv/versions/3.10.3/lib/python3.10/site-packages/click/core.py\", line 1053, in main\r\n rv = self.invoke(ctx)\r\n File \"/Users/lchski/.pyenv/versions/3.10.3/lib/python3.10/site-packages/click/core.py\", line 1395, in invoke\r\n return ctx.invoke(self.callback, **ctx.params)\r\n File \"/Users/lchski/.pyenv/versions/3.10.3/lib/python3.10/site-packages/click/core.py\", line 754, in invoke\r\n return __callback(*args, **kwargs)\r\n File \"/Users/lchski/.pyenv/versions/3.10.3/lib/python3.10/site-packages/healthkit_to_sqlite/cli.py\", line 57, in cli\r\n convert_xml_to_sqlite(fp, db, progress_callback=bar.update, zipfile=zf)\r\n File \"/Users/lchski/.pyenv/versions/3.10.3/lib/python3.10/site-packages/healthkit_to_sqlite/utils.py\", line 34, in convert_xml_to_sqlite\r\n workout_to_db(el, db, zipfile)\r\n File \"/Users/lchski/.pyenv/versions/3.10.3/lib/python3.10/site-packages/healthkit_to_sqlite/utils.py\", line 57, in workout_to_db\r\n pk = db[\"workouts\"].insert(record, alter=True, hash_id=\"id\").last_pk\r\n File \"/Users/lchski/.pyenv/versions/3.10.3/lib/python3.10/site-packages/sqlite_utils/db.py\", line 2822, in insert\r\n return self.insert_all(\r\n File \"/Users/lchski/.pyenv/versions/3.10.3/lib/python3.10/site-packages/sqlite_utils/db.py\", line 2950, in insert_all\r\n self.insert_chunk(\r\n File \"/Users/lchski/.pyenv/versions/3.10.3/lib/python3.10/site-packages/sqlite_utils/db.py\", line 2715, in insert_chunk\r\n result = self.db.execute(query, params)\r\n File \"/Users/lchski/.pyenv/versions/3.10.3/lib/python3.10/site-packages/sqlite_utils/db.py\", line 458, in execute\r\n return self.conn.execute(sql, parameters)\r\nsqlite3.IntegrityError: UNIQUE constraint failed: workouts.id\r\n```\r\n\r\nAre there maybe duplicate workouts in the data, which\u2019d cause multiple rows to share the same `id`? It\u2019s strange, though, that no `workout_points` is created at all. Export created from iOS 15.3.1.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 771608692, "label": "UNIQUE constraint failed: workouts.id"}, "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-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}