Anyquery allows you to export the result of a query to various formats. See below for the full list of supported formats.
Specify the format
Shell mode
To specify the format once you have entered the shell mode, run:
You can also use the short version for some formats:
To revert back to the pretty format (the default one), run:
Flag argument
To specify the format as a flag argument, run:
Redirecting the output
You can redirect the output to a file using the > operator. For example:
In shell mode, you can use .output to specify the output file:
All the next queries will be written to the output.json file. To revert back to the standard output, run:
Supported formats
CSV
Export the result of a query to a CSV (RFC 4180) file.
Example
HTML
Export the result of a query as an HTML table.
Example
JSON
Export the result of a query as a JSON array of objects. Each column is a key in the object.
Example
JSONL
Export the result of a query as a JSON Lines file. Each line is a JSON object representing a row separated by a newline.
Example
Line by line
Export the result of a query where each line is a column of a row. Rows are separated by ---.
Example
Markdown
Export the result of a query as a markdown table that can be pasted to GitHub, Notion, and pretty much any markdown editor.
Example
Plain text
Export the result of a query as plain text (column values separated by a tab and rows separated by a newline). This is the default one if stdout is not a terminal.
Example
Plain with headers
Similar to the plain text format, but with the column names as the first row.
Example
Pretty
Export the result of a query into a nice ASCII table. This is the default one if stdout is a terminal.
Example
TSV
Export the result of a query as a tab-separated values file (alias to plain with headers).
Example
Ugly json
Similar to the JSON format, but without any indentation.
Example
Missing format?
If you need a format that is not supported, please open an issue to request it.