pub struct Insert {Show 27 fields
pub table: TableRef,
pub columns: Vec<Identifier>,
pub values: Vec<Vec<Expression>>,
pub query: Option<Expression>,
pub overwrite: bool,
pub partition: Vec<(Identifier, Option<Expression>)>,
pub directory: Option<DirectoryInsert>,
pub returning: Vec<Expression>,
pub output: Option<OutputClause>,
pub on_conflict: Option<Box<Expression>>,
pub leading_comments: Vec<String>,
pub if_exists: bool,
pub with: Option<With>,
pub ignore: bool,
pub source_alias: Option<Identifier>,
pub alias: Option<Identifier>,
pub alias_explicit_as: bool,
pub default_values: bool,
pub by_name: bool,
pub conflict_action: Option<String>,
pub is_replace: bool,
pub hint: Option<Hint>,
pub replace_where: Option<Box<Expression>>,
pub source: Option<Box<Expression>>,
pub function_target: Option<Box<Expression>>,
pub partition_by: Option<Box<Expression>>,
pub settings: Vec<Expression>,
}Expand description
INSERT statement
Fields§
§table: TableRef§columns: Vec<Identifier>§values: Vec<Vec<Expression>>§query: Option<Expression>§overwrite: boolINSERT OVERWRITE for Hive/Spark
partition: Vec<(Identifier, Option<Expression>)>PARTITION clause for Hive/Spark
directory: Option<DirectoryInsert>INSERT OVERWRITE DIRECTORY for Hive/Spark
returning: Vec<Expression>RETURNING clause (PostgreSQL, SQLite)
output: Option<OutputClause>OUTPUT clause (TSQL)
on_conflict: Option<Box<Expression>>ON CONFLICT clause (PostgreSQL, SQLite)
leading_comments: Vec<String>Leading comments before the statement
if_exists: boolIF EXISTS clause (Hive)
with: Option<With>WITH clause (CTEs)
ignore: boolINSERT IGNORE (MySQL) - ignore duplicate key errors
source_alias: Option<Identifier>Source alias for VALUES clause (MySQL): VALUES (1, 2) AS new_data
alias: Option<Identifier>Table alias (PostgreSQL): INSERT INTO table AS t(…)
alias_explicit_as: boolWhether the alias uses explicit AS keyword
default_values: boolDEFAULT VALUES (PostgreSQL): INSERT INTO t DEFAULT VALUES
by_name: boolBY NAME modifier (DuckDB): INSERT INTO x BY NAME SELECT …
conflict_action: Option<String>SQLite conflict action: INSERT OR ABORT|FAIL|IGNORE|REPLACE|ROLLBACK INTO …
is_replace: boolMySQL/SQLite REPLACE INTO statement (treat like INSERT)
hint: Option<Hint>Oracle-style hint: INSERT /*+ APPEND */ INTO …
replace_where: Option<Box<Expression>>REPLACE WHERE clause (Databricks): INSERT INTO a REPLACE WHERE cond VALUES …
source: Option<Box<Expression>>Source table (Hive/Spark): INSERT OVERWRITE TABLE target TABLE source
function_target: Option<Box<Expression>>ClickHouse: INSERT INTO FUNCTION func_name(…) - the function call
partition_by: Option<Box<Expression>>ClickHouse: PARTITION BY expr
settings: Vec<Expression>ClickHouse: SETTINGS key = val, …