pub enum CopyOption {
Format(Ident),
Freeze(bool),
Delimiter(Option<char>),
Null(String),
Header(bool),
Quote(Option<char>),
Escape(Option<char>),
ForceQuote(Vec<Ident>),
ForceNotNull(Vec<Ident>),
ForceNull(Vec<Ident>),
Encoding(String),
DuckDbOption {
name: Ident,
value: Option<Expr>,
},
}Expand description
An option in COPY statement.
Variants§
Format(Ident)
FORMAT format_name
Freeze(bool)
FREEZE [ boolean ]
Delimiter(Option<char>)
DELIMITER ‘delimiter_character’
DuckDB additionally accepts DELIMITER '', disabling the delimiter;
None is that case, everywhere the empty string is otherwise refused
as “not exactly one character” (unchanged for every other dialect —
see Parser::parse_copy_option_char).
Null(String)
NULL ‘null_string’
Header(bool)
HEADER [ boolean ]
Quote(Option<char>)
QUOTE ‘quote_character’
DuckDB additionally accepts QUOTE '', disabling quoting; None is
that case. See CopyOption::Delimiter.
Escape(Option<char>)
ESCAPE ‘escape_character’
DuckDB additionally accepts ESCAPE '', disabling escaping; None is
that case. See CopyOption::Delimiter.
ForceQuote(Vec<Ident>)
FORCE_QUOTE { ( column_name [, …] ) | * }
ForceNotNull(Vec<Ident>)
FORCE_NOT_NULL ( column_name [, …] )
ForceNull(Vec<Ident>)
FORCE_NULL ( column_name [, …] )
Encoding(String)
ENCODING ‘encoding_name’
DuckDbOption
A DuckDB COPY … (option_name [option_value]) option that is not one of
the fixed PostgreSQL keywords above — e.g. COMPRESSION zstd,
PARTITION_BY (year, month), ROW_GROUP_SIZE 100000, OVERWRITE_OR_IGNORE.
DuckDB’s COPY option set is open-ended, so these are captured generically
as a name and an optional value expression (None = a bare flag).
See https://duckdb.org/docs/stable/sql/statements/copy.