pub struct Insert {Show 26 fields
pub insert_token: AttachedToken,
pub optimizer_hints: Vec<OptimizerHint>,
pub or: Option<SqliteOnConflict>,
pub ignore: bool,
pub into: bool,
pub table: TableObject,
pub table_alias: Option<TableAliasWithoutColumns>,
pub columns: Vec<ObjectName>,
pub overwrite: bool,
pub source: Option<Box<Query>>,
pub assignments: Vec<Assignment>,
pub partitioned: Option<Vec<Expr>>,
pub after_columns: Vec<Ident>,
pub has_table_keyword: bool,
pub on: Option<OnInsert>,
pub returning: Option<Vec<SelectItem>>,
pub output: Option<OutputClause>,
pub replace_into: bool,
pub priority: Option<MysqlInsertPriority>,
pub insert_alias: Option<InsertAliases>,
pub settings: Option<Vec<Setting>>,
pub format_clause: Option<InputFormatClause>,
pub multi_table_insert_type: Option<MultiTableInsertType>,
pub multi_table_into_clauses: Vec<MultiTableInsertIntoClause>,
pub multi_table_when_clauses: Vec<MultiTableInsertWhenClause>,
pub multi_table_else_clause: Option<Vec<MultiTableInsertIntoClause>>,
}Expand description
INSERT statement.
Fields§
§insert_token: AttachedTokenToken for the INSERT keyword (or its substitutes)
optimizer_hints: Vec<OptimizerHint>§or: Option<SqliteOnConflict>Only for Sqlite
ignore: boolOnly for mysql
into: boolINTO - optional keyword
table: TableObjectTABLE
table_alias: Option<TableAliasWithoutColumns>table_name as foo (for PostgreSQL)
table_name foo (for Oracle)
columns: Vec<ObjectName>COLUMNS
overwrite: boolOverwrite (Hive)
source: Option<Box<Query>>A SQL query that specifies what to insert
assignments: Vec<Assignment>MySQL INSERT INTO ... SET
See: https://dev.mysql.com/doc/refman/8.4/en/insert.html
partitioned: Option<Vec<Expr>>partitioned insert (Hive)
after_columns: Vec<Ident>Columns defined after PARTITION
has_table_keyword: boolwhether the insert has the table keyword (Hive)
on: Option<OnInsert>ON INSERT
returning: Option<Vec<SelectItem>>RETURNING
output: Option<OutputClause>§replace_into: boolOnly for mysql
priority: Option<MysqlInsertPriority>Only for mysql
insert_alias: Option<InsertAliases>Only for mysql
settings: Option<Vec<Setting>>Settings used for ClickHouse.
ClickHouse syntax: INSERT INTO tbl SETTINGS format_template_resultset = '/some/path/resultset.format'
format_clause: Option<InputFormatClause>Format for INSERT statement when not using standard SQL format. Can be e.g. CSV,
JSON, JSONAsString, LineAsString and more.
ClickHouse syntax: INSERT INTO tbl FORMAT JSONEachRow {"foo": 1, "bar": 2}, {"foo": 3}
multi_table_insert_type: Option<MultiTableInsertType>For Snowflake multi-table insert: specifies the type (ALL or FIRST)
Nonemeans this is a regular single-table INSERTSome(All)meansINSERT ALL(all matching WHEN clauses are executed)Some(First)meansINSERT FIRST(only the first matching WHEN clause is executed)
See: https://docs.snowflake.com/en/sql-reference/sql/insert-multi-table
multi_table_into_clauses: Vec<MultiTableInsertIntoClause>For multi-table insert: additional INTO clauses (unconditional)
Used for INSERT ALL INTO t1 INTO t2 ... SELECT ...
See: https://docs.snowflake.com/en/sql-reference/sql/insert-multi-table
multi_table_when_clauses: Vec<MultiTableInsertWhenClause>For conditional multi-table insert: WHEN clauses
Used for INSERT ALL/FIRST WHEN cond THEN INTO t1 ... SELECT ...
See: https://docs.snowflake.com/en/sql-reference/sql/insert-multi-table
multi_table_else_clause: Option<Vec<MultiTableInsertIntoClause>>For conditional multi-table insert: ELSE clause
See: https://docs.snowflake.com/en/sql-reference/sql/insert-multi-table
Trait Implementations§
impl Eq for Insert
Source§impl Ord for Insert
impl Ord for Insert
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Insert
impl PartialOrd for Insert
impl StructuralPartialEq for Insert
Source§impl VisitMut for Insert
impl VisitMut for Insert
Source§fn visit<V>(&mut self, visitor: &mut V) -> ControlFlow<<V as VisitorMut>::Break>where
V: VisitorMut,
fn visit<V>(&mut self, visitor: &mut V) -> ControlFlow<<V as VisitorMut>::Break>where
V: VisitorMut,
VisitorMut. Read moreAuto Trait Implementations§
impl Freeze for Insert
impl RefUnwindSafe for Insert
impl Send for Insert
impl Sync for Insert
impl Unpin for Insert
impl UnsafeUnpin for Insert
impl UnwindSafe for Insert
Blanket Implementations§
Source§impl<Source> AccessAs for Source
impl<Source> AccessAs for Source
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more