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/pull/2118#issuecomment-1652681136,https://api.github.com/repos/simonw/datasette/issues/2118,1652681136,IC_kwDOBm6k_c5igemw,9599,simonw,2023-07-26T23:30:44Z,2023-07-26T23:30:44Z,OWNER,"The `_shape=` stuff should use `json_renderer` instead - that's how the table view did it:
https://github.com/simonw/datasette/commit/d97e82df3c8a3f2e97038d7080167be9bb74a68d#diff-5c9ef29c33ed0fde413565b23fa258d60fc3a2bb205b016db9e915c9bd5ecfb3
https://github.com/simonw/datasette/blob/c3e3ecf590ca5fa61b00aba4c78599e33d370b60/datasette/views/table.py#L822-L850
Instead of:
https://github.com/simonw/datasette/blob/c3e3ecf590ca5fa61b00aba4c78599e33d370b60/datasette/views/database.py#L239-L288","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1823352380,New JSON design for query views,
https://github.com/simonw/datasette/pull/2118#issuecomment-1668568445,https://api.github.com/repos/simonw/datasette/issues/2118,1668568445,IC_kwDOBm6k_c5jdFV9,9599,simonw,2023-08-07T20:57:46Z,2023-08-07T20:57:46Z,OWNER,17 failing tests now.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1823352380,New JSON design for query views,
https://github.com/simonw/datasette/pull/2118#issuecomment-1668578107,https://api.github.com/repos/simonw/datasette/issues/2118,1668578107,IC_kwDOBm6k_c5jdHs7,9599,simonw,2023-08-07T21:06:50Z,2023-08-07T21:06:50Z,OWNER,"15:
```
=========================================================================================== short test summary info ============================================================================================
FAILED tests/test_cli.py::test_sql_errors_logged_to_stderr - assert 0 == 1
FAILED tests/test_html.py::test_show_hide_sql_query - AssertionError: assert False
FAILED tests/test_canned_queries.py::test_magic_parameters_cannot_be_used_in_arbitrary_queries - assert 400 == 200
FAILED tests/test_html.py::test_templates_considered[/fixtures-database-fixtures.html, *database.html] - assert '' in '\n\n
\n fixtures\n CSV' in '\n\n\n fixtures: select 1\n ' in '\n\n\n fixtures: select * from...
FAILED tests/test_plugins.py::test_hook_extra_css_urls[/fixtures-expected_decoded_object1] - AssertionError: assert equals failed
FAILED tests/test_plugins.py::test_view_names[/fixtures-database] - AssertionError: assert equals failed
FAILED tests/test_plugins.py::test_view_names[/fixtures?sql=select+1-database] - AssertionError: assert equals failed
FAILED tests/test_plugins.py::test_hook_extra_body_script[/fixtures-expected_extra_body_script1] - AssertionError: assert equals failed
FAILED tests/test_html.py::test_base_url_config[False-/fixtures?sql=select+1] - AssertionError: {
FAILED tests/test_table_api.py::test_max_returned_rows - KeyError: 'query'
FAILED tests/test_html.py::test_alternate_url_json[/fixtures-http://localhost/fixtures.json] - KeyError: 'link'
============================================================================ 15 failed, 1297 passed, 2 skipped, 1 xfailed in 58.15s ============================================================================
```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1823352380,New JSON design for query views,
https://github.com/simonw/datasette/pull/2118#issuecomment-1668687891,https://api.github.com/repos/simonw/datasette/issues/2118,1668687891,IC_kwDOBm6k_c5jdigT,9599,simonw,2023-08-07T23:11:04Z,2023-08-07T23:14:34Z,OWNER,"One of the failing tests is because this URL on my local environment returns this:
http://127.0.0.1:8001/_memory.json?sql=select+blah
```json
{""rows"": [], ""columns"": [], ""truncated"": false}
```
With a 200 status code. It should be an error.
https://latest.datasette.io/_memory.json?sql=select+blah returns a 400 status code with the following JSON:
```json
{
""ok"": false,
""database"": ""_memory"",
""query_name"": null,
""rows"": [],
""truncated"": false,
""columns"": [],
""query"": {
""sql"": ""select blah"",
""params"": {}
},
""error"": ""no such column: blah"",
""private"": false,
""allow_execute_sql"": true,
""query_ms"": 2.68310698447749,
""source"": ""tests/fixtures.py"",
""source_url"": ""https://github.com/simonw/datasette/blob/main/tests/fixtures.py"",
""license"": ""Apache License 2.0"",
""license_url"": ""https://github.com/simonw/datasette/blob/main/LICENSE""
}
```
So I need a design for what this should look like for the error case.
I should consider what errors look like for alternative formats too.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1823352380,New JSON design for query views,
https://github.com/simonw/datasette/pull/2118#issuecomment-1668688947,https://api.github.com/repos/simonw/datasette/issues/2118,1668688947,IC_kwDOBm6k_c5jdiwz,9599,simonw,2023-08-07T23:12:37Z,2023-08-07T23:12:37Z,OWNER,"https://latest.datasette.io/_memory.csv?sql=select+blah is a blank page right now:
```bash
curl -I 'https://latest.datasette.io/_memory.csv?sql=select+blah'
```
```
HTTP/2 200
access-control-allow-origin: *
access-control-allow-headers: Authorization, Content-Type
access-control-expose-headers: Link
access-control-allow-methods: GET, POST, HEAD, OPTIONS
access-control-max-age: 3600
content-type: text/plain; charset=utf-8
x-databases: _memory, _internal, fixtures, fixtures2, extra_database, ephemeral
date: Mon, 07 Aug 2023 23:12:15 GMT
server: Google Frontend
```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1823352380,New JSON design for query views,
https://github.com/simonw/datasette/pull/2118#issuecomment-1668691898,https://api.github.com/repos/simonw/datasette/issues/2118,1668691898,IC_kwDOBm6k_c5jdje6,9599,simonw,2023-08-07T23:15:14Z,2023-08-07T23:16:28Z,OWNER,"New error design:
```json
{""ok"": false, ""error"": ""Error message here"", ""rows"": [], ""columns"": [], ""truncated"": false}
```
I guess that means I need to add `""ok"": true` to the default format as well - which makes sense because table JSON has that already:
https://latest.datasette.io/fixtures/facetable.json
```json
{
""ok"": true,
""next"": null,
""rows"": [...]
}
```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1823352380,New JSON design for query views,
https://github.com/simonw/datasette/pull/2118#issuecomment-1668715803,https://api.github.com/repos/simonw/datasette/issues/2118,1668715803,IC_kwDOBm6k_c5jdpUb,9599,simonw,2023-08-07T23:50:26Z,2023-08-08T01:41:53Z,OWNER,"This bit needs some more work: https://github.com/simonw/datasette/blob/a791115e31e64e9bbd1d36f4d46887b3e42e752a/datasette/views/database.py#L514-L518
The original logic for that is from here, I need to figure out how to replicate it:
https://github.com/simonw/datasette/blob/5139c0886a7f6bb94d317ba0665aa6e728716028/datasette/views/base.py#L368
https://github.com/simonw/datasette/blob/5139c0886a7f6bb94d317ba0665aa6e728716028/datasette/views/base.py#L342-L344
UPDATE: Fixed the `_size=max` bit, but I've not replicated the behaviour where it adds `?_labels=on` if there are expandable columns yet.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1823352380,New JSON design for query views,
https://github.com/simonw/datasette/pull/2118#issuecomment-1668720671,https://api.github.com/repos/simonw/datasette/issues/2118,1668720671,IC_kwDOBm6k_c5jdqgf,9599,simonw,2023-08-07T23:58:21Z,2023-08-07T23:58:21Z,OWNER,"11 tests left:
```
FAILED tests/test_html.py::test_alternate_url_json[/fixtures-http://localhost/fixtures.json] - KeyError: 'link'
FAILED tests/test_html.py::test_alternate_url_json[/fixtures?sql=select+*+from+facetable-http://localhost/fixtures.json?sql=select+*+from+facetable] - assert '' in '\n\n\n fixtures: select * from...
FAILED tests/test_html.py::test_query_page_truncates - assert equals failed
FAILED tests/test_html.py::test_templates_considered[/fixtures-database-fixtures.html, *database.html] - assert '' in '\n\n\n fixtures\n CSV' in '\n\n\n fixtures: select 1\n CSV' in '\n\n\n fixtures: select 1\n UPDATE: Fixed the `_size=max` bit, but I've not replicated the behaviour where it adds `?_labels=on` if there are expandable columns yet.
It looks like that behaviour is only relevant to table views, and it's already implemented - https://latest.datasette.io/fixtures/roadside_attraction_characteristics links to https://latest.datasette.io/fixtures/roadside_attraction_characteristics.csv?_labels=on&_size=max","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1823352380,New JSON design for query views,
https://github.com/simonw/datasette/pull/2118#issuecomment-1668789134,https://api.github.com/repos/simonw/datasette/issues/2118,1668789134,IC_kwDOBm6k_c5jd7OO,9599,simonw,2023-08-08T01:46:12Z,2023-08-08T01:46:12Z,OWNER,"I'm going to squash merge this even though it's a bit big, because I want a clean passing commit in the `main` branch.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1823352380,New JSON design for query views,