{"html_url": "https://github.com/simonw/datasette/issues/1875#issuecomment-1314491150", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1875", "id": 1314491150, "node_id": "IC_kwDOBm6k_c5OWYsO", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-14T22:25:20Z", "updated_at": "2022-11-14T22:25:20Z", "author_association": "OWNER", "body": "That's using JSON Pointer: https://www.rfc-editor.org/rfc/rfc6901\r\n\r\nThere's a Python library for that here https://github.com/stefankoegl/python-json-pointer/blob/master/jsonpointer.py - which looks simple and clean and well maintained and documented, but it only handles the \"what is at this pointer within this JSON object\" case - I need to generate the correct JSON pointer to explain where my error is.\r\n\r\nSo I think I'll end up hand-rolling this.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1430797211, "label": "Figure out design for JSON errors (consider RFC 7807)"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1875#issuecomment-1314488010", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1875", "id": 1314488010, "node_id": "IC_kwDOBm6k_c5OWX7K", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-14T22:21:43Z", "updated_at": "2022-11-14T22:21:43Z", "author_association": "OWNER", "body": "Here's the most relevant example from the RFC spec:\r\n```\r\n POST /details HTTP/1.1\r\n Host: account.example.com\r\n Accept: application/json\r\n```\r\n```json\r\n {\r\n \"age\": 42.3,\r\n \"profile\": {\r\n \"color\": \"yellow\"\r\n }\r\n }\r\n```\r\n```\r\n HTTP/1.1 400 Bad Request\r\n Content-Type: application/problem+json\r\n Content-Language: en\r\n```\r\n```json\r\n{\r\n \"type\": \"https://example.net/validation-error\",\r\n \"title\": \"Your request is not valid.\",\r\n \"errors\": [\r\n {\r\n \"detail\": \"must be a positive integer\",\r\n \"pointer\": \"#/age\"\r\n },\r\n {\r\n \"detail\": \"must be 'green', 'red' or 'blue'\",\r\n \"pointer\": \"#/profile/color\"\r\n }\r\n ]\r\n}\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1430797211, "label": "Figure out design for JSON errors (consider RFC 7807)"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1884#issuecomment-1314054300", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1884", "id": 1314054300, "node_id": "IC_kwDOBm6k_c5OUuCc", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-14T16:40:06Z", "updated_at": "2022-11-14T16:40:06Z", "author_association": "OWNER", "body": "I wonder if there are any reasons that inspect SHOULD try to count virtual tables? Like are there any likely uses for a cirial table where the count is both interesting and likely to be accessed often enough that it's worth caching?\r\n\r\nI have an issue open to add a setting to disable table counts entirely:\r\n\r\n- #1818 \r\n\r\nMaybe that should be expanded to automatically disable row counts for virtual tables entirely? Which would mean no count would be shown for them in the UI.\r\n\r\nIf you desperately wanted a count you would then have to run a count(*) query against them explicitly.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1439009231, "label": "Exclude virtual tables from datasette inspect"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1850#issuecomment-1313156167", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1850", "id": 1313156167, "node_id": "IC_kwDOBm6k_c5ORSxH", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-14T06:23:39Z", "updated_at": "2022-11-14T06:23:39Z", "author_association": "OWNER", "body": "The API explorer is now live here: https://latest-1-0-dev.datasette.io/-/api", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1421529723, "label": "Write API in Datasette core"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1850#issuecomment-1313155712", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1850", "id": 1313155712, "node_id": "IC_kwDOBm6k_c5ORSqA", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-14T06:22:57Z", "updated_at": "2022-11-14T06:22:57Z", "author_association": "OWNER", "body": "I think the ability to create tokens should be protected by a `create-tokens` permission, not just a global setting.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1421529723, "label": "Write API in Datasette core"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1888#issuecomment-1313139657", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1888", "id": 1313139657, "node_id": "IC_kwDOBm6k_c5OROvJ", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-14T06:04:48Z", "updated_at": "2022-11-14T06:04:48Z", "author_association": "OWNER", "body": "Demo: https://latest-1-0-dev.datasette.io/-/api", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1447439985, "label": "API explorer should take immutability into account"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1866#issuecomment-1313128913", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1866", "id": 1313128913, "node_id": "IC_kwDOBm6k_c5ORMHR", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-14T05:48:22Z", "updated_at": "2022-11-14T05:48:22Z", "author_association": "OWNER", "body": "I changed my mind about the `\"return_rows\": true` option - I'm going to rename it to `\"return\": true`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1426001541, "label": "API for bulk inserting records into a table"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1874#issuecomment-1313127054", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1874", "id": 1313127054, "node_id": "IC_kwDOBm6k_c5ORLqO", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-14T05:45:00Z", "updated_at": "2022-11-14T05:45:00Z", "author_association": "OWNER", "body": "Demo: https://latest-1-0-dev.datasette.io/-/api#path=%2Ffixtures%2Ffacetable%2F-%2Fdrop&json=&method=POST\r\n\r\n\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1429030341, "label": "API to drop a table"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1871#issuecomment-1313125870", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1871", "id": 1313125870, "node_id": "IC_kwDOBm6k_c5ORLXu", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-14T05:42:50Z", "updated_at": "2022-11-14T05:42:50Z", "author_association": "OWNER", "body": "Demo: https://latest-1-0-dev.datasette.io/-/api#path=%2Ffixtures%2Ffacetable%2F-%2Fdrop&json=%7B%22confirm%22%3A+true%7D&method=POST", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1427293909, "label": "API explorer tool"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1874#issuecomment-1313125123", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1874", "id": 1313125123, "node_id": "IC_kwDOBm6k_c5ORLMD", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-14T05:41:20Z", "updated_at": "2022-11-14T05:42:23Z", "author_association": "OWNER", "body": "I also changed the confirmation JSON returned by this endpoint to add the `database` and `table` like so:\r\n```json\r\n{\r\n \"ok\": true,\r\n \"database\": \"data\",\r\n \"table\": \"docs\",\r\n \"row_count\": 1,\r\n \"message\": \"Pass \\\"confirm\\\": true to confirm\"\r\n}\r\n```\r\nUpdated docs: https://docs.datasette.io/en/1.0-dev/json_api.html#dropping-tables", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1429030341, "label": "API to drop a table"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1874#issuecomment-1313119558", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1874", "id": 1313119558, "node_id": "IC_kwDOBm6k_c5ORJ1G", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-14T05:30:27Z", "updated_at": "2022-11-14T05:30:27Z", "author_association": "OWNER", "body": "Found a bug: you get a 500 error if you try this against an immutable database.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1429030341, "label": "API to drop a table"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1850#issuecomment-1313115059", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1850", "id": 1313115059, "node_id": "IC_kwDOBm6k_c5ORIuz", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-14T05:21:30Z", "updated_at": "2022-11-14T05:21:30Z", "author_association": "OWNER", "body": "New documentation for these features currently lives here: https://docs.datasette.io/en/1.0-dev/json_api.html#the-json-write-api", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1421529723, "label": "Write API in Datasette core"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1875#issuecomment-1313114283", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1875", "id": 1313114283, "node_id": "IC_kwDOBm6k_c5ORIir", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-14T05:20:00Z", "updated_at": "2022-11-14T05:20:00Z", "author_association": "OWNER", "body": "I started a conversation about JSON error standards on Mastodon here: https://fedi.simonwillison.net/web/@simon/109338725610487457\r\n\r\nQuite a few people pointed to this RFC independently.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1430797211, "label": "Figure out design for JSON errors (consider RFC 7807)"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1887#issuecomment-1313113642", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1887", "id": 1313113642, "node_id": "IC_kwDOBm6k_c5ORIYq", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-14T05:18:51Z", "updated_at": "2022-11-14T05:18:51Z", "author_association": "OWNER", "body": "Updated docs: https://docs.datasette.io/en/1.0-dev/json_api.html#dropping-tables", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1447388809, "label": "Add a confirm step to the drop table API"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1887#issuecomment-1313097713", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1887", "id": 1313097713, "node_id": "IC_kwDOBm6k_c5OREfx", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-14T05:00:54Z", "updated_at": "2022-11-14T05:00:54Z", "author_association": "OWNER", "body": "I'm going to add a `\"confirm\": true` option to the API. Without that, it returns a note about how many rows will be deleted.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1447388809, "label": "Add a confirm step to the drop table API"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1871#issuecomment-1313097057", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1871", "id": 1313097057, "node_id": "IC_kwDOBm6k_c5OREVh", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-14T04:59:28Z", "updated_at": "2022-11-14T04:59:28Z", "author_association": "OWNER", "body": "In playing with the API explorer just now I realized it's way too easy to accidentally drop a table using it.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1427293909, "label": "API explorer tool"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1871#issuecomment-1313072900", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1871", "id": 1313072900, "node_id": "IC_kwDOBm6k_c5OQ-cE", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-14T04:15:50Z", "updated_at": "2022-11-14T04:15:50Z", "author_association": "OWNER", "body": "For the example links - I'm going to have these at the bottom of the page so you don't have to scroll past them.\r\n\r\nIdeally these would take the user's permissions into account. This could make the page expensive to load, but I'm going to risk it for the moment.\r\n\r\nSomething like this then:\r\n\r\n> - data\r\n> - /data/-/create - create table\r\n> - /data/table1/-/insert - insert into table1\r\n> - /data/table1/-/drop - drop table1\r\n\r\nI won't bother with per-row demo links (for update and delete) because there could be thousands of them for each table.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1427293909, "label": "API explorer tool"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1871#issuecomment-1313062699", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1871", "id": 1313062699, "node_id": "IC_kwDOBm6k_c5OQ78r", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-14T04:03:29Z", "updated_at": "2022-11-14T04:12:41Z", "author_association": "OWNER", "body": "Two things left before I close this issue:\r\n\r\n- [x] I want to preserve the state of the forms in the URL - probably after a `#`\r\n- [ ] Instead of hard-coding the current examples, I want to provide a list of links which populate the forms", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1427293909, "label": "API explorer tool"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1886#issuecomment-1313052863", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1886", "id": 1313052863, "node_id": "IC_kwDOBm6k_c5OQ5i_", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-14T03:40:50Z", "updated_at": "2022-11-14T03:40:50Z", "author_association": "OWNER", "body": "Tim Sherratt on Twitter: https://twitter.com/wragge/status/1591930345469153282\r\n\r\n> Where do I start? The [#GLAMWorkbench](https://twitter.com/hashtag/GLAMWorkbench?src=hashtag_click) now includes a number of examples where GLAM data is harvested, processed, and then made available for exploration via Datasette.\r\n>\r\n> https://glam-workbench.net/\r\n>\r\n> For example the GLAM Name Index Search brings together 10+ million entries from 240 indexes and provides an aggregated search using the Datasette search-all plugin:\r\n>\r\n> https://glam-workbench.net/name-search/\r\n>\r\n> Most recently I converted PDFs of the Tasmanian Postal Directories to a big Datasette instance: https://updates.timsherratt.org/2022/09/15/from-pdfs-to.html the process is documented and reusable.", "reactions": "{\"total_count\": 1, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 1, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1447050738, "label": "Call for birthday presents: if you're using Datasette, let us know how you're using it here"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1871#issuecomment-1312822353", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1871", "id": 1312822353, "node_id": "IC_kwDOBm6k_c5OQBRR", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-13T21:07:40Z", "updated_at": "2022-11-13T21:07:40Z", "author_association": "OWNER", "body": "I'm going to need extra code to toggle POST closed when GET opens and vice-versa.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1427293909, "label": "API explorer tool"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1871#issuecomment-1312821031", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1871", "id": 1312821031, "node_id": "IC_kwDOBm6k_c5OQA8n", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-13T21:02:06Z", "updated_at": "2022-11-13T21:03:11Z", "author_association": "OWNER", "body": "Actually no, I'm going to add a class of `details-menu` to the other details elements that SHOULD be closed. That way custom templates using `` won't close in a surprising way.", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1427293909, "label": "API explorer tool"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1871#issuecomment-1312816451", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1871", "id": 1312816451, "node_id": "IC_kwDOBm6k_c5OP_1D", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-13T20:39:26Z", "updated_at": "2022-11-13T20:39:34Z", "author_association": "OWNER", "body": "I'm going to add a special `no-auto-close` class to these and teach that code not to close them.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1427293909, "label": "API explorer tool"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1871#issuecomment-1312816292", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1871", "id": 1312816292, "node_id": "IC_kwDOBm6k_c5OP_yk", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-13T20:38:42Z", "updated_at": "2022-11-13T20:38:42Z", "author_association": "OWNER", "body": "The current API explorer uses details/summary elements for the GET and POST dialogs.\r\n\r\nI only want one of these to be open at a time, to reflect that you can make either a GET or a POST.\r\n\r\nI just noticed that clicking anywhere else on the page closes both elements, which isn't what I want to happen. Turns out that's because of this code I added as part of Datasette's menu implementation!\r\n\r\nhttps://github.com/simonw/datasette/blob/9f54f00a50a4d950cfd69a0ff3526ae82c858826/datasette/templates/_close_open_menus.html#L2-L15", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1427293909, "label": "API explorer tool"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1882#issuecomment-1312582512", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1882", "id": 1312582512, "node_id": "IC_kwDOBm6k_c5OPGtw", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-12T22:11:18Z", "updated_at": "2022-11-12T22:11:18Z", "author_association": "OWNER", "body": "I like this:\r\n\r\n\r\n\r\n```json\r\n{\r\n \"ok\": true,\r\n \"database\": \"data\",\r\n \"table\": \"agai2n\",\r\n \"table_url\": \"http://127.0.0.1:8001/data/agai2n\",\r\n \"schema\": \"CREATE TABLE [agai2n] (\\n [hello] INTEGER\\n)\"\r\n}\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1435294468, "label": "`/db/-/create` API for creating tables"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1882#issuecomment-1312581121", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1882", "id": 1312581121, "node_id": "IC_kwDOBm6k_c5OPGYB", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-12T22:01:32Z", "updated_at": "2022-11-12T22:01:32Z", "author_association": "OWNER", "body": "I'm going to change it to `table` in the output AND the input.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1435294468, "label": "`/db/-/create` API for creating tables"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1882#issuecomment-1312581008", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1882", "id": 1312581008, "node_id": "IC_kwDOBm6k_c5OPGWQ", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-12T22:00:52Z", "updated_at": "2022-11-12T22:00:52Z", "author_association": "OWNER", "body": "Tried out my prototype in the API explorer:\r\n\r\n\r\n\r\nThe `\"name\"` on the output is bothering me a bit - should it be `table_name` or `table` instead?\r\n\r\nProblem is I really like `name` for the input, so should it be consistent to have the same name on the output here, or should I aim for consistency with other endpoints that might return `table` rather than the ambiguous `name` elsewhere?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1435294468, "label": "`/db/-/create` API for creating tables"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1882#issuecomment-1312580348", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1882", "id": 1312580348, "node_id": "IC_kwDOBm6k_c5OPGL8", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-12T21:55:54Z", "updated_at": "2022-11-12T21:56:45Z", "author_association": "OWNER", "body": "What should this API return?\r\n\r\nI think the name of the table (`name`), the URL to that table (`table_url` - for consistency with how faceting API works already) and the schema of the table (`schema`).", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1435294468, "label": "`/db/-/create` API for creating tables"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1882#issuecomment-1312575048", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1882", "id": 1312575048, "node_id": "IC_kwDOBm6k_c5OPE5I", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-12T21:22:58Z", "updated_at": "2022-11-12T21:22:58Z", "author_association": "OWNER", "body": "Need to validate the table name. SQLite supports almost any table name - but they can't contain a newline character and cannot start with `sqlite_` - according to https://stackoverflow.com/questions/3694276/what-are-valid-table-names-in-sqlite/43049720#43049720", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1435294468, "label": "`/db/-/create` API for creating tables"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1882#issuecomment-1312556044", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1882", "id": 1312556044, "node_id": "IC_kwDOBm6k_c5OPAQM", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-12T19:29:11Z", "updated_at": "2022-11-12T19:29:11Z", "author_association": "OWNER", "body": "Thought of an edge-case: with `sqlite-utils` one feature I really like is that I can pipe data into it without caring if the table already exists or not:\r\n\r\n cat data.json | sqlite-utils insert my.db mytable -\r\n\r\nHow could this new API support that?\r\n\r\nI thought about adding a `\"create\": true` option to `/db/table/-/insert` which creates the table if it doesn't already exist, but if I do that I'll need to start adding other options to that endpoint - to set the primary key, add foreign keys and suchlike - which would be ignored except for the cases where the table was being created from scratch.\r\n\r\nThis doesn't feel right to me - I want to keep those options here, on `/db/-/create`.\r\n\r\nOne idea I had was to implement it such that you can call `/db/-/create` multiple times for the same table, but only if you are using the `\"rows\"` option. If so, and if the rows can be safely inserted, it would let you do that.\r\n\r\nBut instead, I'm going to outsource this to the CLI tool I plan to write that feeds data into this API. I'm already planning to use that tool for CSV inserts (so the API doesn't need to accept CSV directly). I think it's a good place for other usability enhancements like \"insert this, creating the table if it does not exist\" as well.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1435294468, "label": "`/db/-/create` API for creating tables"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1883#issuecomment-1311314981", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1883", "id": 1311314981, "node_id": "IC_kwDOBm6k_c5OKRQl", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-11T07:15:48Z", "updated_at": "2022-11-11T07:15:48Z", "author_association": "OWNER", "body": "I released that fix in Datasette 0.63.1: https://docs.datasette.io/en/stable/changelog.html#v0-63-1", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1435917503, "label": "Errors when using table filters behind a proxy"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1883#issuecomment-1311299535", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1883", "id": 1311299535, "node_id": "IC_kwDOBm6k_c5OKNfP", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-11T06:54:58Z", "updated_at": "2022-11-11T06:54:58Z", "author_association": "OWNER", "body": "This time deployed with:\r\n```\r\ncd demos/apache-proxy\r\nfly deploy --build-arg DATASETTE_REF=8d9a957c6329d26cc1e417b5d6911640d74765eb\r\n```\r\nTo ensure the exact commit with the fix.\r\n\r\nAnd that fixed it!\r\n```\r\n% curl -i 'https://datasette-apache-proxy-demo.datasette.io/prefix/fixtures/binary_data?_filter_column=rowid&_filter_op=exact&_filter_value=1&_sort=rowid'\r\nHTTP/2 302 \r\ndate: Fri, 11 Nov 2022 06:54:45 GMT\r\nserver: Fly/b1863e2e7 (2022-11-09)\r\nlocation: /prefix/fixtures/binary_data?_sort=rowid&rowid__exact=1\r\nlink: ; rel=preload\r\ncontent-type: text/plain\r\nx-proxied-by: Apache2 Debian\r\nvia: 2 fly.io\r\nfly-request-id: 01GHJQGBSXBR7E53TY0EKMQ9PA-sjc\r\n```\r\n\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1435917503, "label": "Errors when using table filters behind a proxy"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1883#issuecomment-1311292463", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1883", "id": 1311292463, "node_id": "IC_kwDOBm6k_c5OKLwv", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-11T06:44:24Z", "updated_at": "2022-11-11T06:44:24Z", "author_association": "OWNER", "body": "Modifying that test to the following does indeed cause a failure:\r\n```python\r\ndef test_base_url_affects_filter_redirects(app_client_base_url_prefix):\r\n response = app_client_base_url_prefix.get(\r\n \"/fixtures/binary_data?_filter_column=rowid&_filter_op=exact&_filter_value=1&_sort=rowid\"\r\n )\r\n assert response.status == 302\r\n assert (\r\n response.headers[\"location\"]\r\n == \"/prefix/fixtures/binary_data?_sort=rowid&rowid__exact=1\"\r\n )\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1435917503, "label": "Errors when using table filters behind a proxy"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1883#issuecomment-1311291632", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1883", "id": 1311291632, "node_id": "IC_kwDOBm6k_c5OKLjw", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-11T06:43:00Z", "updated_at": "2022-11-11T06:43:00Z", "author_association": "OWNER", "body": "https://datasette-apache-proxy-demo.datasette.io/prefix/-/asgi-scope is useful:\r\n\r\nIt confirms that `/prefix/` is nowhere to be seen in the incoming request data:\r\n\r\n```\r\n 'path': '/-/asgi-scope',\r\n 'query_string': b'',\r\n 'raw_path': b'/-/asgi-scope',\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1435917503, "label": "Errors when using table filters behind a proxy"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1883#issuecomment-1311290115", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1883", "id": 1311290115, "node_id": "IC_kwDOBm6k_c5OKLMD", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-11T06:40:14Z", "updated_at": "2022-11-11T06:41:56Z", "author_association": "OWNER", "body": "I modified that config file to have this line instead:\r\n```\r\n ProxyPass /prefix/ http://127.0.0.1:8001/ nocanon\r\n```\r\nAnd then deployed it by running:\r\n\r\n flyctl deploy --build-arg DATASETTE_REF=main\r\n\r\nThis does NOT seem to have fixed the bug:\r\n\r\n```\r\n~ % curl -i 'https://datasette-apache-proxy-demo.datasette.io/prefix/fixtures/binary_data?_filter_column=rowid&_filter_op=exact&_filter_value=1&_sort=rowid'\r\nHTTP/2 302 \r\ndate: Fri, 11 Nov 2022 06:40:01 GMT\r\nserver: Fly/b1863e2e7 (2022-11-09)\r\nlocation: /fixtures/binary_data?_sort=rowid&rowid__exact=1\r\nlink: ; rel=preload\r\ncontent-type: text/plain\r\nx-proxied-by: Apache2 Debian\r\nvia: 2 fly.io\r\nfly-request-id: 01GHJPNCF51CJ626EWZEHK2CH9-sjc\r\n```\r\n\r\nhttps://datasette-apache-proxy-demo.datasette.io/prefix/-/versions seems to confirm that this is the latest deployed version (0.63), so it looks like the deploy worked.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1435917503, "label": "Errors when using table filters behind a proxy"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1883#issuecomment-1311286593", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1883", "id": 1311286593, "node_id": "IC_kwDOBm6k_c5OKKVB", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-11T06:34:09Z", "updated_at": "2022-11-11T06:34:09Z", "author_association": "OWNER", "body": "https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxypass includes this note:\r\n\r\n> Normally, mod_proxy will canonicalise ProxyPassed URLs. But this may be incompatible with some backends, particularly those that make use of *PATH_INFO*. The optional *nocanon* keyword suppresses this and passes the URL path \"raw\" to the backend.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1435917503, "label": "Errors when using table filters behind a proxy"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1883#issuecomment-1311284537", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1883", "id": 1311284537, "node_id": "IC_kwDOBm6k_c5OKJ05", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-11T06:30:38Z", "updated_at": "2022-11-11T06:30:38Z", "author_association": "OWNER", "body": "Is there a chance that it's Apache that's messing with that `location:` header here, not Datasette?\r\n\r\nhttps://github.com/simonw/datasette/blob/bbaab3b38ec2ce5944239ffbe2dd53328df40fff/demos/apache-proxy/000-default.conf#L7-L13", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1435917503, "label": "Errors when using table filters behind a proxy"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1883#issuecomment-1311283301", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1883", "id": 1311283301, "node_id": "IC_kwDOBm6k_c5OKJhl", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-11T06:28:38Z", "updated_at": "2022-11-11T06:29:33Z", "author_association": "OWNER", "body": "`path_with_added_args(request, redirect_params)` should be preserving the current path from the request.\r\n\r\nhttps://github.com/simonw/datasette/blob/bbaab3b38ec2ce5944239ffbe2dd53328df40fff/datasette/utils/__init__.py#L273-L286", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1435917503, "label": "Errors when using table filters behind a proxy"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1883#issuecomment-1311282970", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1883", "id": 1311282970, "node_id": "IC_kwDOBm6k_c5OKJca", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-11T06:28:05Z", "updated_at": "2022-11-11T06:28:05Z", "author_association": "OWNER", "body": "Relevant code: https://github.com/simonw/datasette/blob/bbaab3b38ec2ce5944239ffbe2dd53328df40fff/datasette/views/table.py#L227-L249", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1435917503, "label": "Errors when using table filters behind a proxy"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1883#issuecomment-1311280709", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1883", "id": 1311280709, "node_id": "IC_kwDOBm6k_c5OKI5F", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-11T06:25:27Z", "updated_at": "2022-11-11T06:25:27Z", "author_association": "OWNER", "body": "I tried adding this test but it passed! I expected it to fail:\r\n\r\n```python\r\ndef test_base_url_affects_filter_redirects(app_client_base_url_prefix):\r\n response = app_client_base_url_prefix.get(\r\n \"/prefix/fixtures/binary_data?_filter_column=rowid&_filter_op=exact&_filter_value=1&_sort=rowid\"\r\n )\r\n assert response.status == 302\r\n assert (\r\n response.headers[\"location\"]\r\n == \"/prefix/fixtures/binary_data?_sort=rowid&rowid__exact=1\"\r\n )\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1435917503, "label": "Errors when using table filters behind a proxy"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1883#issuecomment-1311278678", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1883", "id": 1311278678, "node_id": "IC_kwDOBm6k_c5OKIZW", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-11T06:22:37Z", "updated_at": "2022-11-11T06:22:37Z", "author_association": "OWNER", "body": "If you view source on that page the HTML looks correct:\r\n```html\r\n