mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
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:
parent
56adfff8d2
commit
a23c2aee00
21 changed files with 148 additions and 83 deletions
|
|
@ -25,7 +25,8 @@ def test_crossdb_join(app_client_two_attached_databases_crossdb_enabled):
|
|||
fixtures.searchable
|
||||
"""
|
||||
response = app_client.get(
|
||||
"/_memory.json?" + urllib.parse.urlencode({"sql": sql, "_shape": "array"})
|
||||
"/_memory/-/query.json?"
|
||||
+ urllib.parse.urlencode({"sql": sql, "_shape": "array"})
|
||||
)
|
||||
assert response.status == 200
|
||||
assert response.json == [
|
||||
|
|
@ -67,9 +68,10 @@ def test_crossdb_attached_database_list_display(
|
|||
):
|
||||
app_client = app_client_two_attached_databases_crossdb_enabled
|
||||
response = app_client.get("/_memory")
|
||||
response2 = app_client.get("/")
|
||||
for fragment in (
|
||||
"databases are attached to this connection",
|
||||
"<li><strong>fixtures</strong> - ",
|
||||
"<li><strong>extra database</strong> - ",
|
||||
'<li><strong>extra database</strong> - <a href="/extra+database/-/query?sql=',
|
||||
):
|
||||
assert fragment in response.text
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue