mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-25 18:34:32 +02:00
Output [] in JSON mode if no rows, closes #328
This commit is contained in:
parent
77c240df56
commit
7427a9137f
2 changed files with 15 additions and 1 deletions
|
|
@ -2225,6 +2225,9 @@ def output_rows(iterator, headers, nl, arrays, json_cols):
|
|||
)
|
||||
yield line
|
||||
first = False
|
||||
if first:
|
||||
# We didn't output any rows, so yield the empty list
|
||||
yield "[]"
|
||||
|
||||
|
||||
def maybe_json(value):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue