mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 17:34:32 +02:00
sqlite-utils rows now obeys --json-cols
This commit is contained in:
parent
092e1368ed
commit
cec8c3c482
2 changed files with 6 additions and 4 deletions
|
|
@ -386,6 +386,7 @@ def rows(ctx, path, dbtable, nl, arrays, csv, no_headers, table, fmt, json_cols)
|
|||
no_headers=no_headers,
|
||||
table=table,
|
||||
fmt=fmt,
|
||||
json_cols=json_cols,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -496,12 +496,13 @@ def test_query_json_with_json_cols(db_path):
|
|||
result = CliRunner().invoke(
|
||||
cli.cli, [db_path, "select id, name, friends from dogs", "--json-cols"]
|
||||
)
|
||||
assert (
|
||||
r"""
|
||||
expected = r"""
|
||||
[{"id": 1, "name": "Cleo", "friends": [{"name": "Pancakes"}, {"name": "Bailey"}]}]
|
||||
""".strip()
|
||||
== result.output.strip()
|
||||
)
|
||||
assert expected == result.output.strip()
|
||||
# Test rows command too
|
||||
result_rows = CliRunner().invoke(cli.cli, ["rows", db_path, "dogs", "--json-cols"])
|
||||
assert expected == result_rows.output.strip()
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue