mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Don't include columns in query JSON, refs #2136
This commit is contained in:
parent
8920d425f4
commit
e34d09c6ec
4 changed files with 14 additions and 8 deletions
|
|
@ -649,7 +649,6 @@ async def test_custom_sql(ds_client):
|
|||
{"content": "RENDER_CELL_DEMO"},
|
||||
{"content": "RENDER_CELL_ASYNC"},
|
||||
],
|
||||
"columns": ["content"],
|
||||
"ok": True,
|
||||
"truncated": False,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,11 +34,12 @@ def test_serve_with_get(tmp_path_factory):
|
|||
"/_memory.json?sql=select+sqlite_version()",
|
||||
],
|
||||
)
|
||||
assert 0 == result.exit_code, result.output
|
||||
assert {
|
||||
"truncated": False,
|
||||
"columns": ["sqlite_version()"],
|
||||
}.items() <= json.loads(result.output).items()
|
||||
assert result.exit_code == 0, result.output
|
||||
data = json.loads(result.output)
|
||||
# Should have a single row with a single column
|
||||
assert len(data["rows"]) == 1
|
||||
assert list(data["rows"][0].keys()) == ["sqlite_version()"]
|
||||
assert set(data.keys()) == {"rows", "ok", "truncated"}
|
||||
|
||||
# The plugin should have created hello.txt
|
||||
assert (plugins_dir / "hello.txt").read_text() == "hello"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue