{"html_url": "https://github.com/simonw/datasette/pull/1931#issuecomment-1341821213", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1931", "id": 1341821213, "node_id": "IC_kwDOBm6k_c5P-pEd", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-08T00:58:21Z", "updated_at": "2022-12-08T00:58:21Z", "author_association": "OWNER", "body": "In the interests of shipping, I'm going to punt the API explorer to a later issue.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1473814539, "label": "/db/table/-/upsert"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1931#issuecomment-1341825314", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1931", "id": 1341825314, "node_id": "IC_kwDOBm6k_c5P-qEi", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-08T01:03:18Z", "updated_at": "2022-12-08T01:03:18Z", "author_association": "OWNER", "body": "I broke this test:\r\n```\r\nds_write = \r\n\r\n @pytest.mark.asyncio\r\n async def test_insert_row(ds_write):\r\n token = write_token(ds_write)\r\n response = await ds_write.client.post(\r\n \"/data/docs/-/insert\",\r\n json={\"row\": {\"title\": \"Test\", \"score\": 1.2, \"age\": 5}},\r\n headers={\r\n \"Authorization\": \"***\".format(token),\r\n \"Content-Type\": \"application/json\",\r\n },\r\n )\r\n expected_row = {\"id\": 1, \"title\": \"Test\", \"score\": 1.2, \"age\": 5}\r\n> assert response.status_code == 201\r\nE assert 500 == 201\r\nE + where 500 = .status_code\r\n\r\n/home/runner/work/datasette/datasette/tests/test_api_write.py:43: AssertionError\r\n----------------------------- Captured stderr call -----------------------------\r\nTraceback (most recent call last):\r\n File \"/home/runner/work/datasette/datasette/datasette/app.py\", line 1447, in route_path\r\n response = await view(request, send)\r\n File \"/home/runner/work/datasette/datasette/datasette/views/base.py\", line 151, in view\r\n return await self.dispatch_request(request)\r\n File \"/home/runner/work/datasette/datasette/datasette/views/base.py\", line 105, in dispatch_request\r\n response = await handler(request)\r\n File \"/home/runner/work/datasette/datasette/datasette/views/table.py\", line 1228, in post\r\n row_pk_values_for_later = [tuple(row[pk] for pk in pks) for row in rows]\r\n File \"/home/runner/work/datasette/datasette/datasette/views/table.py\", line 1228, in \r\n row_pk_values_for_later = [tuple(row[pk] for pk in pks) for row in rows]\r\n File \"/home/runner/work/datasette/datasette/datasette/views/table.py\", line 1228, in \r\n row_pk_values_for_later = [tuple(row[pk] for pk in pks) for row in rows]\r\nKeyError: 'id'\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1473814539, "label": "/db/table/-/upsert"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1937#issuecomment-1341848525", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1937", "id": 1341848525, "node_id": "IC_kwDOBm6k_c5P-vvN", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-08T01:34:03Z", "updated_at": "2022-12-08T01:34:03Z", "author_association": "OWNER", "body": "Check should go somewhere around here: https://github.com/simonw/datasette/blob/dee18ed8ce7af2ab8699bcb5a51a99f48301bc42/datasette/views/database.py#L625-L631", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1483320357, "label": "/db/-/create API should require insert-rows permission to use row: or rows: option"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1936#issuecomment-1341849496", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1936", "id": 1341849496, "node_id": "IC_kwDOBm6k_c5P-v-Y", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-08T01:35:35Z", "updated_at": "2022-12-08T01:35:35Z", "author_association": "OWNER", "body": "Related bug: you can send `\"id\": null` and it works (it should throw an error):\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": 1483250004, "label": "Fix /db/table/-/upsert in the API explorer"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1936#issuecomment-1341849735", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1936", "id": 1341849735, "node_id": "IC_kwDOBm6k_c5P-wCH", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-08T01:35:54Z", "updated_at": "2022-12-08T01:35:54Z", "author_association": "OWNER", "body": "Running that twice produced this:\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": 1483250004, "label": "Fix /db/table/-/upsert in the API explorer"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1636#issuecomment-1341854373", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1636", "id": 1341854373, "node_id": "IC_kwDOBm6k_c5P-xKl", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-08T01:43:35Z", "updated_at": "2022-12-08T01:43:35Z", "author_association": "OWNER", "body": "I'm going to write the documentation for this first.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1138008042, "label": "\"permissions\" propery in metadata for configuring arbitrary permissions"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1867#issuecomment-1341874378", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1867", "id": 1341874378, "node_id": "IC_kwDOBm6k_c5P-2DK", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-08T02:07:06Z", "updated_at": "2022-12-08T02:28:02Z", "author_association": "OWNER", "body": "Basic version of this allows you to rename a table:\r\n\r\n```\r\nPOST /db/table/-/rename\r\n{\r\n \"name\": \"new_table_name\"\r\n}\r\n```\r\nIf a table with that new name already exists you will get an error - unless you pass `\"replace\": true` in which case that table will be dropped and replaced by the new one.\r\n\r\n\r\n```\r\nPOST /db/table/-/rename\r\n{\r\n \"name\": \"new_table_name\",\r\n \"replace\": true\r\n}\r\n```\r\n\r\nThis is useful because it allows for that atomic replacement operation: upload brand new data into a `_tmp_name` table, then atomic rename and replace after the upload has completed.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1426080014, "label": "/db/table/-/rename API (also allows atomic replace)"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1930#issuecomment-1343360006", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1930", "id": 1343360006, "node_id": "IC_kwDOBm6k_c5QEgwG", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-08T21:12:28Z", "updated_at": "2022-12-08T21:12:28Z", "author_association": "OWNER", "body": "Thanks!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1473664029, "label": "Typo in JSON API `Updating a row` documentation"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1636#issuecomment-1343440504", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1636", "id": 1343440504, "node_id": "IC_kwDOBm6k_c5QE0Z4", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-08T22:10:28Z", "updated_at": "2022-12-08T22:10:48Z", "author_association": "OWNER", "body": "What if you want to grant `insert-row` to a user for ALL tables in a database, or even for all tables in all databases?\r\n\r\nYou should be able to do that by putting that in the root `permissions:` block. Need to figure out how the implementation will handle that.\r\n\r\nAlso: there are some permissions like `view-instance` or `debug-menu` for which putting them at the `database` or `table` or `query` level doesn't actually make any sense.\r\n\r\nIdeally the implementation would spot those on startup and refuse to start the server, with a helpful error message.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1138008042, "label": "\"permissions\" propery in metadata for configuring arbitrary permissions"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1938#issuecomment-1343445885", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1938", "id": 1343445885, "node_id": "IC_kwDOBm6k_c5QE1t9", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-08T22:16:03Z", "updated_at": "2022-12-08T22:16:03Z", "author_association": "OWNER", "body": "Docs: https://datasette--1938.org.readthedocs.build/en/1938/authentication.html#other-permissions-in-metadata", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1485488236, "label": "\"permissions\" blocks in metadata.json/yaml"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1636#issuecomment-1343446071", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1636", "id": 1343446071, "node_id": "IC_kwDOBm6k_c5QE1w3", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-08T22:16:17Z", "updated_at": "2022-12-08T22:16:17Z", "author_association": "OWNER", "body": "First draft of documentation: https://datasette--1938.org.readthedocs.build/en/1938/authentication.html#other-permissions-in-metadata", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1138008042, "label": "\"permissions\" propery in metadata for configuring arbitrary permissions"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1931#issuecomment-1339906241", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1931", "id": 1339906241, "node_id": "IC_kwDOBm6k_c5P3VjB", "user": {"value": 22429695, "label": "codecov[bot]"}, "created_at": "2022-12-06T19:33:32Z", "updated_at": "2022-12-08T01:04:56Z", "author_association": "NONE", "body": "# [Codecov](https://codecov.io/gh/simonw/datasette/pull/1931?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) Report\nBase: **90.42**% // Head: **91.77**% // Increases project coverage by **`+1.34%`** :tada:\n> Coverage data is based on head [(`645be0f`)](https://codecov.io/gh/simonw/datasette/pull/1931?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) compared to base [(`cab5b60`)](https://codecov.io/gh/simonw/datasette/commit/cab5b60e09e94aca820dbec5308446a88c99ea3d?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison).\n> Patch coverage: 95.55% of modified lines in pull request are covered.\n\n> :exclamation: Current head 645be0f differs from pull request most recent head 7cd6fd9. Consider uploading reports for the commit 7cd6fd9 to get more accurate results\n\n
Additional details and impacted files\n\n\n```diff\n@@ Coverage Diff @@\n## main #1931 +/- ##\n==========================================\n+ Coverage 90.42% 91.77% +1.34% \n==========================================\n Files 36 36 \n Lines 5057 5019 -38 \n==========================================\n+ Hits 4573 4606 +33 \n+ Misses 484 413 -71 \n```\n\n\n| [Impacted Files](https://codecov.io/gh/simonw/datasette/pull/1931?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) | Coverage \u0394 | |\n|---|---|---|\n| [datasette/views/special.py](https://codecov.io/gh/simonw/datasette/pull/1931/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison#diff-ZGF0YXNldHRlL3ZpZXdzL3NwZWNpYWwucHk=) | `79.41% <0.00%> (\u00f8)` | |\n| [datasette/views/table.py](https://codecov.io/gh/simonw/datasette/pull/1931/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison#diff-ZGF0YXNldHRlL3ZpZXdzL3RhYmxlLnB5) | `92.44% <97.43%> (+0.20%)` | :arrow_up: |\n| [datasette/app.py](https://codecov.io/gh/simonw/datasette/pull/1931/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison#diff-ZGF0YXNldHRlL2FwcC5weQ==) | `94.42% <100.00%> (+<0.01%)` | :arrow_up: |\n| [datasette/default\\_permissions.py](https://codecov.io/gh/simonw/datasette/pull/1931/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison#diff-ZGF0YXNldHRlL2RlZmF1bHRfcGVybWlzc2lvbnMucHk=) | `94.81% <100.00%> (+0.07%)` | :arrow_up: |\n| [datasette/views/database.py](https://codecov.io/gh/simonw/datasette/pull/1931/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison#diff-ZGF0YXNldHRlL3ZpZXdzL2RhdGFiYXNlLnB5) | `95.83% <0.00%> (+17.01%)` | :arrow_up: |\n\nHelp us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison)\n\n
\n\n[:umbrella: View full report at Codecov](https://codecov.io/gh/simonw/datasette/pull/1931?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison). \n:loudspeaker: Do you have feedback about the report comment? [Let us know in this issue](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison).\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1473814539, "label": "/db/table/-/upsert"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1938#issuecomment-1343449918", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1938", "id": 1343449918, "node_id": "IC_kwDOBm6k_c5QE2s-", "user": {"value": 22429695, "label": "codecov[bot]"}, "created_at": "2022-12-08T22:20:10Z", "updated_at": "2022-12-08T22:54:08Z", "author_association": "NONE", "body": "# [Codecov](https://codecov.io/gh/simonw/datasette/pull/1938?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) Report\nBase: **92.00**% // Head: **92.01**% // Increases project coverage by **`+0.01%`** :tada:\n> Coverage data is based on head [(`6e35a6b`)](https://codecov.io/gh/simonw/datasette/pull/1938?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) compared to base [(`e539c1c`)](https://codecov.io/gh/simonw/datasette/commit/e539c1c024bc62d88df91d9107cbe37e7f0fe55f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison).\n> Patch coverage: 100.00% of modified lines in pull request are covered.\n\n
Additional details and impacted files\n\n\n```diff\n@@ Coverage Diff @@\n## main #1938 +/- ##\n==========================================\n+ Coverage 92.00% 92.01% +0.01% \n==========================================\n Files 38 38 \n Lines 5378 5386 +8 \n==========================================\n+ Hits 4948 4956 +8 \n Misses 430 430 \n```\n\n\n| [Impacted Files](https://codecov.io/gh/simonw/datasette/pull/1938?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) | Coverage \u0394 | |\n|---|---|---|\n| [datasette/default\\_permissions.py](https://codecov.io/gh/simonw/datasette/pull/1938/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison#diff-ZGF0YXNldHRlL2RlZmF1bHRfcGVybWlzc2lvbnMucHk=) | `95.10% <100.00%> (+0.29%)` | :arrow_up: |\n\nHelp us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison)\n\n
\n\n[:umbrella: View full report at Codecov](https://codecov.io/gh/simonw/datasette/pull/1938?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison). \n:loudspeaker: Do you have feedback about the report comment? [Let us know in this issue](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison).\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1485488236, "label": "\"permissions\" blocks in metadata.json/yaml"}, "performed_via_github_app": null}