Introduce new /$DB/-/query endpoint, soft replaces /$DB?sql=... (#2363)

* Introduce new default /$DB/-/query endpoint
* Fix a lot of tests
* Update pyodide test to use query endpoint
* Link to /fixtures/-/query in a few places
* Documentation for QueryView

---------

Co-authored-by: Simon Willison <swillison@gmail.com>
This commit is contained in:
Alex Garcia 2024-07-15 10:33:51 -07:00 committed by GitHub
commit a23c2aee00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 148 additions and 83 deletions

View file

@ -57,7 +57,7 @@ async def test_table_shape_arrays(ds_client):
@pytest.mark.asyncio
async def test_table_shape_arrayfirst(ds_client):
response = await ds_client.get(
"/fixtures.json?"
"/fixtures/-/query.json?"
+ urllib.parse.urlencode(
{
"sql": "select content from simple_primary_key order by id",
@ -699,7 +699,7 @@ async def test_table_through(ds_client):
@pytest.mark.asyncio
async def test_max_returned_rows(ds_client):
response = await ds_client.get(
"/fixtures.json?sql=select+content+from+no_primary_key"
"/fixtures/-/query.json?sql=select+content+from+no_primary_key"
)
data = response.json()
assert data["truncated"]