pub enum Format {
Show 16 variants
DuckBox,
Box,
Table,
Markdown,
Line,
List,
Csv,
Tsv,
Json,
JsonLines,
Quote,
Insert,
Html,
Ascii,
Column,
Trash,
}Expand description
What a result is printed as.
Variants§
DuckBox
The default. A box with the column types under the names and a row count under the table.
Box
A box without the type row and without the row count.
Table
The same table drawn in +, - and |.
Markdown
A GitHub flavoured markdown table.
Line
One name = value per line, a blank line between rows.
List
Values joined by the separator, which defaults to a pipe.
Csv
Comma separated, with the quoting rules of RFC 4180.
Tsv
Tab separated.
Json
One JSON array of objects.
JsonLines
One JSON object per line.
Quote
Single quoted values, comma separated, in the spelling SQL wants.
Insert
One INSERT statement per row.
Html
Table rows and cells as HTML, without the surrounding table element, which is what DuckDB emits.
Ascii
One value per line, columns first, no decoration at all.
Column
Space padded columns under a dashed rule.
Trash
Nothing at all, for timing a query without paying to print it.
Implementations§
Source§impl Format
impl Format
Sourcepub fn from_name(name: &str) -> Option<Self>
pub fn from_name(name: &str) -> Option<Self>
The mode of that name, or None if there is no such mode.
Sourcepub fn from_flag(name: &str) -> Option<Self>
pub fn from_flag(name: &str) -> Option<Self>
The mode a command line flag names, or None when there is no flag of that name.
Twelve of the sixteen modes are also flags and four of them are not, and the four are an
error rather than a mode. This is upstream’s list rather than a rule, so it is written out
rather than derived: duckdb -help has a line for each of these twelve and no line for
-duckbox, -insert, -tabs or -trash, and asking v2.0.0-dev84237 for any of those four
gets Unrecognized option and a non zero exit. The aliases are not flags either, so
-lines, -tsv and -ndjson are refused while .mode lines is still accepted. Per #238.