Closed fzakaria closed 9 months ago
There is reason and it was reason from almost 20 years ago, when the SQLite shell didn't have JSON output and jsonl wasn't a thing yet. The reason back then was anticipating wanting to join the output of multiple queries which is why use JSON and not a different format, since it would allow each query result to have different columns, and then have manual [
/ ]
put around it. Anyway that reason is very bogus now.
The fix is:
json
output the [
/ ]
around the results each timejsonl
which does newline delimited jsonSounds reasonable.
The json output mode emits trailing commas which makes it difficult to parse with many standard JSON tools like
jq
or python itself.Here is me generating the list:
Failing with JQ:
Failing with Python:
I think this can be remedied by wrapping the row results in brackets to make them a list which would make it compliant.