pub struct Insert {
pub name: Slice,
pub columns: Slice,
pub source: QueryRef,
pub returning: Option<QueryRef>,
pub conflict: Option<Conflict>,
pub copy: bool,
}Expand description
INSERT INTO name (columns) query.
Fields§
§name: SliceThe table name, as a run of parts, outermost first.
columns: SliceThe column list, as a run of parts, empty when the statement did not write one.
source: QueryRefWhat produces the rows, which is a VALUES clause or any other query, or NONE for
DEFAULT VALUES, which is one row of every column’s default.
returning: Option<QueryRef>The RETURNING list, held as SELECT list FROM table [AS alias] and run over the rows the
statement wrote rather than over the table.
conflict: Option<Conflict>What an INSERT does with a row whose key the table already holds, when it said.
copy: boolWhether this is a COPY t FROM 'file', held as INSERT INTO t SELECT * FROM read_csv('file', ...).
The two differ in one way the rewrite cannot say by itself, which is that COPY reads the
file as the table’s column types rather than as the ones the sniffer would pick and then
casts. The binder hands the table’s columns to the read_csv under it when this is set.