pub struct Settings {
pub format: Format,
pub header: bool,
pub separator: String,
pub newline: String,
pub nullvalue: String,
pub table: String,
}Expand description
Everything about how output is printed, which is what the dot commands change.
Fields§
§format: FormatThe output mode.
header: boolWhether to print the column names.
separator: StringWhat goes between two values in the separated modes.
newline: StringWhat goes between two rows in the separated modes.
nullvalue: StringWhat a null prints as in the modes that do not have a spelling of their own for it.
table: StringThe table name .mode insert puts in the statements it writes.
Implementations§
Source§impl Settings
impl Settings
Sourcepub fn set_format(&mut self, format: Format)
pub fn set_format(&mut self, format: Format)
Switches mode, resetting both separators to that mode’s defaults.
Resetting is DuckDB’s behaviour and it surprises people, so it is worth saying why it is
right: .mode csv means “write me a CSV”, and a pipe separator left over from an earlier
.mode list would produce a file that is not one. The header setting is deliberately left
alone, which is also DuckDB’s behaviour and was checked against the binary rather than
guessed, because .headers off is a thing somebody says once and expects to stay said.