html_url,issue_url,id,node_id,user,user_label,created_at,updated_at,author_association,body,reactions,issue,issue_label,performed_via_github_app
https://github.com/simonw/datasette/issues/1875#issuecomment-1314615592,https://api.github.com/repos/simonw/datasette/issues/1875,1314615592,IC_kwDOBm6k_c5OW3Eo,9599,simonw,2022-11-15T01:04:28Z,2022-11-15T01:04:28Z,OWNER,"Worth noting this bit in RFC 7807:
> The fictional problem type here defines the ""errors"" extension, an
> array that describes the details of each validation error. Each
> member is an object containing ""detail"" to describe the issue, and
> ""pointer"" to locate the problem within the request's content using a
> JSON Pointer [JSON-POINTER].
So the list of `""errors""` with JSON Pointer isn't technically part of the spec, it's an imaginary extension.
It fits what I need to do though, so I'm inclined to stick with it anyway.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1430797211,Figure out design for JSON errors (consider RFC 7807),
https://github.com/simonw/datasette/issues/1875#issuecomment-1314620086,https://api.github.com/repos/simonw/datasette/issues/1875,1314620086,IC_kwDOBm6k_c5OW4K2,9599,simonw,2022-11-15T01:09:56Z,2022-11-15T01:09:56Z,OWNER,"Rough initial prototype:
```diff
diff --git a/datasette/views/table.py b/datasette/views/table.py
index 8b987221..518ac578 100644
--- a/datasette/views/table.py
+++ b/datasette/views/table.py
@@ -1103,19 +1103,30 @@ class TableInsertView(BaseView):
except json.JSONDecodeError as e:
return _errors([""Invalid JSON: {}"".format(e)])
if not isinstance(data, dict):
- return _errors([""JSON must be a dictionary""])
+ return _errors([{""detail"": ""JSON must be a dictionary"", ""pointer"": ""#/""}])
keys = data.keys()
# keys must contain ""row"" or ""rows""
if ""row"" not in keys and ""rows"" not in keys:
return _errors(['JSON must have one or other of ""row"" or ""rows""'])
rows = []
+ was_single_row = False
if ""row"" in keys:
if ""rows"" in keys:
- return _errors(['Cannot use ""row"" and ""rows"" at the same time'])
+ return _errors(
+ [
+ {
+ ""detail"": 'Cannot use ""row"" and ""rows"" at the same time',
+ ""pointer"": ""#/row"",
+ }
+ ]
+ )
+ was_single_row = True
row = data[""row""]
if not isinstance(row, dict):
- return _errors(['""row"" must be a dictionary'])
+ return _errors(
+ [{""detail"": '""row"" must be a dictionary', ""pointer"": ""#/row""}]
+ )
rows = [row]
data[""return""] = True
else:
@@ -1152,9 +1163,12 @@ class TableInsertView(BaseView):
invalid_columns = set(row.keys()) - columns
if invalid_columns:
errors.append(
- ""Row {} has invalid columns: {}"".format(
- i, "", "".join(sorted(invalid_columns))
- )
+ {
+ ""detail"": ""Invalid columns: {}"".format(
+ "", "".join(sorted(invalid_columns))
+ ),
+ ""pointer"": ""#/blah/"",
+ }
)
if errors:
return _errors(errors)
```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1430797211,Figure out design for JSON errors (consider RFC 7807),
https://github.com/simonw/datasette/issues/1886#issuecomment-1314627077,https://api.github.com/repos/simonw/datasette/issues/1886,1314627077,IC_kwDOBm6k_c5OW54F,11788561,jrdmb,2022-11-15T01:19:54Z,2022-11-15T01:19:54Z,NONE,"Datasette usage comments for its 5th anniversary celebration:
I 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)
The 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.
At 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.
I 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.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1447050738,"Call for birthday presents: if you're using Datasette, let us know how you're using it here",
https://github.com/simonw/datasette/issues/1882#issuecomment-1314813205,https://api.github.com/repos/simonw/datasette/issues/1882,1314813205,IC_kwDOBm6k_c5OXnUV,9599,simonw,2022-11-15T06:00:41Z,2022-11-15T06:00:41Z,OWNER,"Documentation:
- https://docs.datasette.io/en/1.0-dev/json_api.html#creating-a-table
- https://docs.datasette.io/en/1.0-dev/json_api.html#creating-a-table-from-example-data
Wrote a TIL about how I wrote some of those tests with Copilot: https://til.simonwillison.net/gpt3/writing-test-with-copilot","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1435294468,`/db/-/create` API for creating tables,
https://github.com/simonw/datasette/issues/1890#issuecomment-1314821337,https://api.github.com/repos/simonw/datasette/issues/1890,1314821337,IC_kwDOBm6k_c5OXpTZ,9599,simonw,2022-11-15T06:08:19Z,2022-11-15T06:08:19Z,OWNER,"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.
There's actually a native HTML element for this these days: the `