pub struct CopyTo {
pub plan: Plan,
pub path: String,
pub header: bool,
pub delimiter: String,
pub quote: String,
pub escape: String,
pub null: String,
pub force_quote: Vec<String>,
pub force_quote_all: bool,
pub json: bool,
pub array: bool,
}Expand description
A bound COPY ... TO a CSV or a JSON file, with every option read and defaulted.
The CSV defaults are the pin’s: a header line, a comma, a double quote that is its own escape, and
a null written as nothing at all. The escape does not follow the quote, so QUOTE '''' alone
still escapes with a double quote, which is what the pin writes.
Fields§
§plan: PlanThe query whose rows are written.
path: StringThe file.
header: boolWhether the first line names the columns.
delimiter: StringWhat goes between two values.
quote: StringWhat a value is quoted with.
escape: StringWhat comes before a quote inside a quoted value.
null: StringWhat a null is written as.
force_quote: Vec<String>The columns every value of which is quoted, by name.
force_quote_all: boolWhether every column is, which is FORCE_QUOTE *.
json: boolWhether the file is JSON rather than CSV, and the CSV options above are left alone.
array: boolFor JSON, whether the rows go in one array rather than one object a line.