{"html_url": "https://github.com/simonw/datasette/pull/1893#issuecomment-1316041828", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1893", "id": 1316041828, "node_id": "IC_kwDOBm6k_c5OcTRk", "user": {"value": 95570, "label": "bgrins"}, "created_at": "2022-11-15T23:51:35Z", "updated_at": "2022-11-15T23:51:35Z", "author_association": "CONTRIBUTOR", "body": "I experimented with autocompleting the actual schema in https://github.com/bgrins/datasette/commit/8431c98850c7a552dbcde2a4dd0c3dc942a97d25, but it would need some work (current problems with it listed in the commit message there)", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1450363982, "label": "Upgrade to CodeMirror 6, add SQL autocomplete"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1893#issuecomment-1315869946", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1893", "id": 1315869946, "node_id": "IC_kwDOBm6k_c5ObpT6", "user": {"value": 95570, "label": "bgrins"}, "created_at": "2022-11-15T21:12:38Z", "updated_at": "2022-11-15T21:12:38Z", "author_association": "CONTRIBUTOR", "body": "https://github.com/Sphinxxxx/cm-resize isn't compatible with 6. There's a suggestion to try using CSS resize in https://discuss.codemirror.net/t/resizing-codemirror-6/3265/2", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1450363982, "label": "Upgrade to CodeMirror 6, add SQL autocomplete"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1893#issuecomment-1315869040", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1893", "id": 1315869040, "node_id": "IC_kwDOBm6k_c5ObpFw", "user": {"value": 95570, "label": "bgrins"}, "created_at": "2022-11-15T21:11:42Z", "updated_at": "2022-11-15T21:11:42Z", "author_association": "CONTRIBUTOR", "body": "extraKeys is done - Shift+Enter is added in the helper function, and it appears that the Tab behavior now defaults to what the `Tab: false` setting was doing (allowing it to escape to the form)", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1450363982, "label": "Upgrade to CodeMirror 6, add SQL autocomplete"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1893#issuecomment-1315853097", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1893", "id": 1315853097, "node_id": "IC_kwDOBm6k_c5OblMp", "user": {"value": 95570, "label": "bgrins"}, "created_at": "2022-11-15T20:55:40Z", "updated_at": "2022-11-15T20:55:40Z", "author_association": "CONTRIBUTOR", "body": "Should also minify the bundled output", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1450363982, "label": "Upgrade to CodeMirror 6, add SQL autocomplete"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1892#issuecomment-1315814786", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1892", "id": 1315814786, "node_id": "IC_kwDOBm6k_c5Obb2C", "user": {"value": 4399499, "label": "ocdtrekkie"}, "created_at": "2022-11-15T20:14:38Z", "updated_at": "2022-11-15T20:14:38Z", "author_association": "NONE", "body": "I have no particular point, I just want to say being around for the 1.0 release of Datasette seems historic and legendary to witness.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1450312343, "label": "Merge 1.0-dev branch back to main"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1863#issuecomment-1315812212", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1863", "id": 1315812212, "node_id": "IC_kwDOBm6k_c5ObbN0", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-15T20:12:02Z", "updated_at": "2022-11-15T20:12:02Z", "author_association": "OWNER", "body": "If the update succeeds it will return `{\"ok\": true}`.\r\n\r\nFor consistency with `/db/table/-/insert` you can pass `\"return\": true` and it will return a `\"row\"` key with the now-updated full row.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1425029242, "label": "Update a single record in an existing table"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1863#issuecomment-1315809867", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1863", "id": 1315809867, "node_id": "IC_kwDOBm6k_c5ObapL", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-15T20:09:44Z", "updated_at": "2022-11-15T20:09:44Z", "author_association": "OWNER", "body": "I'm also not going to implement `\"alter\": true` yet (which would add any missing columns based on the update) - I'll hold that off for a later feature.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1425029242, "label": "Update a single record in an existing table"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1863#issuecomment-1315809260", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1863", "id": 1315809260, "node_id": "IC_kwDOBm6k_c5Obafs", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-15T20:09:11Z", "updated_at": "2022-11-15T20:09:11Z", "author_association": "OWNER", "body": "I'm going to use the error format I've been experimenting with here:\r\n- #1875\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```\r\nI'm not quite ready to commit to a `type` URL though, so I'll leave that to be solved later should I fully embrace that RFC.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1425029242, "label": "Update a single record in an existing table"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1863#issuecomment-1315808062", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1863", "id": 1315808062, "node_id": "IC_kwDOBm6k_c5ObaM-", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-15T20:08:04Z", "updated_at": "2022-11-15T20:08:04Z", "author_association": "OWNER", "body": "The initial design I'm going to implement will look like this:\r\n\r\n```\r\nPOST /db/table/1/-/update\r\nAuthorization: Bearer xxx\r\nContent-Type: application/json\r\n```\r\n```json\r\n{\r\n \"update\": {\r\n \"name\": \"New name\"\r\n }\r\n}\r\n```\r\nAny fields that are not yet columns will return an error.\r\n\r\nShould it enforce types, in as much as an integer column should have a JSON integer passed to it, or should it allow strings containing valid integers?\r\n\r\nI'm going to allow strings, mainly as a workaround for the fact that JavaScript integers have a maximum size.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1425029242, "label": "Update a single record in an existing table"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1892#issuecomment-1315805498", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1892", "id": 1315805498, "node_id": "IC_kwDOBm6k_c5ObZk6", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-15T20:05:30Z", "updated_at": "2022-11-15T20:05:30Z", "author_association": "OWNER", "body": "One slight concern: https://latest.datasette.io/ will increasingly reflect a version that isn't the most recent production release.\r\n\r\nI might setup https://stable.datasette.io/ as a demo instance of the most recent non-alpha release to compensate for that.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1450312343, "label": "Merge 1.0-dev branch back to main"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1892#issuecomment-1315804535", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1892", "id": 1315804535, "node_id": "IC_kwDOBm6k_c5ObZV3", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-15T20:04:38Z", "updated_at": "2022-11-15T20:04:38Z", "author_association": "OWNER", "body": "I'll do this after the 1.0a0 release:\r\n- #1708", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1450312343, "label": "Merge 1.0-dev branch back to main"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1890#issuecomment-1314891228", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1890", "id": 1314891228, "node_id": "IC_kwDOBm6k_c5OX6Xc", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-15T07:23:01Z", "updated_at": "2022-11-15T07:23:01Z", "author_association": "OWNER", "body": "Annoying: Mobile Safari doesn't seem to support separate labels and values. I should probably disable this feature on that browser, at least for foreign key facets (for the moment).", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1448143294, "label": "Autocomplete text entry for filter values that correspond to facets"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1890#issuecomment-1314856513", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1890", "id": 1314856513, "node_id": "IC_kwDOBm6k_c5OXx5B", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-15T06:56:29Z", "updated_at": "2022-11-15T06:56:29Z", "author_association": "OWNER", "body": "Looks like I can fix that like so:\r\n```html\r\n\r\n \r\n \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": 1448143294, "label": "Autocomplete text entry for filter values that correspond to facets"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1890#issuecomment-1314850524", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1890", "id": 1314850524, "node_id": "IC_kwDOBm6k_c5OXwbc", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-15T06:48:37Z", "updated_at": "2022-11-15T06:48:37Z", "author_association": "OWNER", "body": "Spotted a bug with this on https://latest.datasette.io/fixtures/facetable?_facet=_city_id - the `_city_id` column is a foreign key, so you need to type `1` or `2` - but the autocomplete list shows the full text names for the cities.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1448143294, "label": "Autocomplete text entry for filter values that correspond to facets"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1890#issuecomment-1314849867", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1890", "id": 1314849867, "node_id": "IC_kwDOBm6k_c5OXwRL", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-15T06:47:51Z", "updated_at": "2022-11-15T06:47:51Z", "author_association": "OWNER", "body": "Demo now live here: https://congress-legislators.datasettes.com/legislators/legislator_terms?_facet=party - select `party` and start typing.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1448143294, "label": "Autocomplete text entry for filter values that correspond to facets"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1890#issuecomment-1314848432", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1890", "id": 1314848432, "node_id": "IC_kwDOBm6k_c5OXv6w", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-15T06:46:08Z", "updated_at": "2022-11-15T06:46:08Z", "author_association": "OWNER", "body": "Wrote a TIL about ``: https://til.simonwillison.net/html/datalist", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1448143294, "label": "Autocomplete text entry for filter values that correspond to facets"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1862#issuecomment-1314845667", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1862", "id": 1314845667, "node_id": "IC_kwDOBm6k_c5OXvPj", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-15T06:42:09Z", "updated_at": "2022-11-15T06:42:32Z", "author_association": "OWNER", "body": "I implemented this as part of `/db/-/create`.\r\n\r\nhttps://docs.datasette.io/en/1.0-dev/json_api.html#creating-a-table-from-example-data", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1425011030, "label": "Create a new table from one or more records, `sqlite-utils` style"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1890#issuecomment-1314835740", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1890", "id": 1314835740, "node_id": "IC_kwDOBm6k_c5OXs0c", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-15T06:30:26Z", "updated_at": "2022-11-15T06:30:26Z", "author_association": "OWNER", "body": "That prototype actually works really well! I'm going to add that to `table.js`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1448143294, "label": "Autocomplete text entry for filter values that correspond to facets"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1890#issuecomment-1314833881", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1890", "id": 1314833881, "node_id": "IC_kwDOBm6k_c5OXsXZ", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-15T06:27:21Z", "updated_at": "2022-11-15T06:27:21Z", "author_association": "OWNER", "body": "Here's a prototype:\r\n```javascript\r\nfunction createDataLists() {\r\n var facetResults = document.querySelectorAll(\".facet-results [data-column]\");\r\n Array.from(facetResults).forEach(function (facetResult) {\r\n // Use link text from all links in the facet result\r\n var linkTexts = Array.from(\r\n facetResult.querySelectorAll(\"li:not(.facet-truncated) a\")\r\n ).map(function (link) {\r\n return link.textContent;\r\n });\r\n // Create a datalist element\r\n var datalist = document.createElement(\"datalist\");\r\n datalist.id = \"datalist-\" + facetResult.dataset.column;\r\n // Create an option element for each link text\r\n linkTexts.forEach(function (linkText) {\r\n var option = document.createElement(\"option\");\r\n option.value = linkText;\r\n datalist.appendChild(option);\r\n });\r\n // Add the datalist to the facet result\r\n facetResult.appendChild(datalist);\r\n });\r\n}\r\ncreateDataLists();\r\n\r\n// When any select with name=_filter_column changes, update the datalist\r\ndocument.body.addEventListener(\"change\", function (event) {\r\n if (event.target.name === \"_filter_column\") {\r\n event.target\r\n .closest(\".filter-row\")\r\n .querySelector(\".filter-value\")\r\n .setAttribute(\"list\", \"datalist-\" + event.target.value);\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": 1448143294, "label": "Autocomplete text entry for filter values that correspond to facets"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1890#issuecomment-1314829751", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1890", "id": 1314829751, "node_id": "IC_kwDOBm6k_c5OXrW3", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-15T06:20:50Z", "updated_at": "2022-11-15T06:20:50Z", "author_association": "OWNER", "body": "This finds the right links on the page:\r\n\r\n document.querySelectorAll('.facet-results [data-column] li:not(.facet-truncated) a')", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1448143294, "label": "Autocomplete text entry for filter values that correspond to facets"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1890#issuecomment-1314825019", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1890", "id": 1314825019, "node_id": "IC_kwDOBm6k_c5OXqM7", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-15T06:13:36Z", "updated_at": "2022-11-15T06:13:36Z", "author_association": "OWNER", "body": "This could start out as a purely JavaScript enhancement for pages that already figured out the available values through faceting, like you suggested.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1448143294, "label": "Autocomplete text entry for filter values that correspond to facets"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1890#issuecomment-1314823752", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1890", "id": 1314823752, "node_id": "IC_kwDOBm6k_c5OXp5I", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-15T06:11:49Z", "updated_at": "2022-11-15T06:11:49Z", "author_association": "OWNER", "body": "I tried this out on https://congress-legislators.datasettes.com/legislators/legislator_terms for the `party` column - here's the demo:\r\n\r\n![datalist](https://user-images.githubusercontent.com/9599/201839812-db887ce0-c4b9-432c-8620-5ac73f222a63.gif)\r\n\r\nI made this work by dropping the following HTML into the page in the browser DevTools:\r\n```html\r\n\r\n\r\n```\r\nAnd then adding `list=\"party\"` to the input element in the filter form.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1448143294, "label": "Autocomplete text entry for filter values that correspond to facets"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1890#issuecomment-1314821337", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1890", "id": 1314821337, "node_id": "IC_kwDOBm6k_c5OXpTZ", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-15T06:08:19Z", "updated_at": "2022-11-15T06:08:19Z", "author_association": "OWNER", "body": "Oh interesting... this doesn't even need to be attached to the visible faceting feature, necessarily: Datasette could try to detect when a column has a limited number of options (which the faceting code handles already) and could turn those into an auto-complete interface.\r\n\r\nThere's actually a native HTML element for this these days: the `` https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1448143294, "label": "Autocomplete text entry for filter values that correspond to facets"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1882#issuecomment-1314813205", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1882", "id": 1314813205, "node_id": "IC_kwDOBm6k_c5OXnUV", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-15T06:00:41Z", "updated_at": "2022-11-15T06:00:41Z", "author_association": "OWNER", "body": "Documentation:\r\n\r\n- https://docs.datasette.io/en/1.0-dev/json_api.html#creating-a-table\r\n- https://docs.datasette.io/en/1.0-dev/json_api.html#creating-a-table-from-example-data\r\n\r\nWrote a TIL about how I wrote some of those tests with Copilot: https://til.simonwillison.net/gpt3/writing-test-with-copilot", "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/1886#issuecomment-1314627077", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1886", "id": 1314627077, "node_id": "IC_kwDOBm6k_c5OW54F", "user": {"value": 11788561, "label": "jrdmb"}, "created_at": "2022-11-15T01:19:54Z", "updated_at": "2022-11-15T01:19:54Z", "author_association": "NONE", "body": "Datasette usage comments for its 5th anniversary celebration:\r\n\r\nI use Datasette and related tools for a Cosmology Researcher Talks database app project, which is [described in the github Readme](https://github.com/jrdmb/cosmotalks-datasette#readme) \r\n\r\nThe app hosted on the Google Cloud Run service also uses other Datasette-related tools developed by Simon - datasette-render-markdown, csvs-to-sqlite, datasette-template-sql, and datasette-block-robots. This is one of two apps used for querying the talks database, each has it pros/cons as described in the github Readme.\r\n\r\nAt present, over 170 different sites that host cosmology talks are scraped to collect new talks for import into the sqlite database. The shot-scraper and sqlite-utils tools are a major help for this.\r\n\r\nI also use the Mastodon API to get my favorites, toots, and boosts into a local database so I can do searches on the data. This was done on Twitter and was then extended to the Mastodon data. Again, sqlite-utils is an important tool for this.\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"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/1875#issuecomment-1314620086", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1875", "id": 1314620086, "node_id": "IC_kwDOBm6k_c5OW4K2", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-15T01:09:56Z", "updated_at": "2022-11-15T01:09:56Z", "author_association": "OWNER", "body": "Rough initial prototype:\r\n```diff\r\ndiff --git a/datasette/views/table.py b/datasette/views/table.py\r\nindex 8b987221..518ac578 100644\r\n--- a/datasette/views/table.py\r\n+++ b/datasette/views/table.py\r\n@@ -1103,19 +1103,30 @@ class TableInsertView(BaseView):\r\n except json.JSONDecodeError as e:\r\n return _errors([\"Invalid JSON: {}\".format(e)])\r\n if not isinstance(data, dict):\r\n- return _errors([\"JSON must be a dictionary\"])\r\n+ return _errors([{\"detail\": \"JSON must be a dictionary\", \"pointer\": \"#/\"}])\r\n keys = data.keys()\r\n \r\n # keys must contain \"row\" or \"rows\"\r\n if \"row\" not in keys and \"rows\" not in keys:\r\n return _errors(['JSON must have one or other of \"row\" or \"rows\"'])\r\n rows = []\r\n+ was_single_row = False\r\n if \"row\" in keys:\r\n if \"rows\" in keys:\r\n- return _errors(['Cannot use \"row\" and \"rows\" at the same time'])\r\n+ return _errors(\r\n+ [\r\n+ {\r\n+ \"detail\": 'Cannot use \"row\" and \"rows\" at the same time',\r\n+ \"pointer\": \"#/row\",\r\n+ }\r\n+ ]\r\n+ )\r\n+ was_single_row = True\r\n row = data[\"row\"]\r\n if not isinstance(row, dict):\r\n- return _errors(['\"row\" must be a dictionary'])\r\n+ return _errors(\r\n+ [{\"detail\": '\"row\" must be a dictionary', \"pointer\": \"#/row\"}]\r\n+ )\r\n rows = [row]\r\n data[\"return\"] = True\r\n else:\r\n@@ -1152,9 +1163,12 @@ class TableInsertView(BaseView):\r\n invalid_columns = set(row.keys()) - columns\r\n if invalid_columns:\r\n errors.append(\r\n- \"Row {} has invalid columns: {}\".format(\r\n- i, \", \".join(sorted(invalid_columns))\r\n- )\r\n+ {\r\n+ \"detail\": \"Invalid columns: {}\".format(\r\n+ \", \".join(sorted(invalid_columns))\r\n+ ),\r\n+ \"pointer\": \"#/blah/\",\r\n+ }\r\n )\r\n if errors:\r\n return _errors(errors)\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/1875#issuecomment-1314615592", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1875", "id": 1314615592, "node_id": "IC_kwDOBm6k_c5OW3Eo", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-11-15T01:04:28Z", "updated_at": "2022-11-15T01:04:28Z", "author_association": "OWNER", "body": "Worth noting this bit in RFC 7807:\r\n\r\n> The fictional problem type here defines the \"errors\" extension, an\r\n> array that describes the details of each validation error. Each\r\n> member is an object containing \"detail\" to describe the issue, and\r\n> \"pointer\" to locate the problem within the request's content using a\r\n> JSON Pointer [JSON-POINTER].\r\n\r\nSo the list of `\"errors\"` with JSON Pointer isn't technically part of the spec, it's an imaginary extension.\r\n\r\nIt fits what I need to do though, so I'm inclined to stick with it anyway.", "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/1708#issuecomment-1095675839", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1708", "id": 1095675839, "node_id": "IC_kwDOBm6k_c5BTq-_", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-04-11T23:06:30Z", "updated_at": "2022-11-15T19:57:53Z", "author_association": "OWNER", "body": "# Datasette 1.0 alpha 1\r\n\r\nThis alpha release is a preview of Datasette 1.0.\r\n\r\nDatasette 1.0 marks a significant milestone in the project: it is the point from which various aspects of Datasette can be considered \"stable\", in that code developed against them should expect not to be broken by future releases in the 1.x series.\r\n\r\nThis will hold true until the next major version release, Datasette 2.0 - which we hope to hold off releasing for as long as possible.\r\n\r\nThe following Datasette components should be be considered stable after 1.0:\r\n\r\n- The plugin API. Plugins developed against 1.0 should continue to work unmodified throughout the 1.x series.\r\n- The JSON API. Code written that interacts with Datasette's default JSON web API should continue to work.\r\n- The template context. If you build custom templates against Datasette your custom pages should continue to work.\r\n\r\nNote that none of these components will cease to introduce new features. New plugin hooks, new JSON APIs and new template context variables can be introduced without breaking existing code.\r\n\r\nSince this alpha release previews features that will be frozen for 1.0, please test this thoroughly against your existing Datasette projects.\r\n\r\nYou can install the alpha using:\r\n\r\n pip install datasette==1.0a0\r\n\r\n## JSON API changes\r\n\r\nThe most significant changes introduced in this new alpha concern Datasette's JSON API.\r\n\r\nThe default JSON returned by the `/database/table.json` endpoint has changed. It now returns an object with two keys: `rows` - which contains a list of objects representing the rows in the table or query, and `more` containing a `boolean` that shows if there are more rows or if this object contains them all.\r\n\r\n```json\r\n{\r\n \"rows\": [{\r\n \"id\": 1,\r\n \"name\": \"Name 1\"\r\n }, {\r\n \"id\": 2,\r\n \"name\": \"Name 2\"\r\n }],\r\n \"more\": false\r\n}\r\n```\r\n[ Initially I thought about going with `next_url`, which would be `null` if you have reached the last page of records. Maybe that would be better? But since `next_url` cannot be provided on query pages, should this be part of the default format at all? ]\r\n\r\n## Use ?_extra= to retrieve extra fields\r\n\r\nThe default format can be expanded using one or more `?_extra=` parameters. This takes names of extra keys you would like to include. These can be comma-separated or `?_extra=` can be applied multiple times.\r\n\r\nFor example:\r\n\r\n /database/table.json?_extra=total\r\n\r\nThis adds a `\"total\": 124` field to the returned JSON.\r\n\r\n[ Question: if you do `?_facet=foo` then do you still need to do `?_extra=facets` - I think not? ]", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1200649124, "label": "Datasette 1.0 alpha upcoming release notes"}, "performed_via_github_app": null}