pub struct Insert {Show 19 fields
pub or: Option<SqliteOnConflict>,
pub ignore: bool,
pub into: bool,
pub table: TableObject,
pub table_alias: Option<Ident>,
pub columns: Vec<Ident>,
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 replace_into: bool,
pub priority: Option<MysqlInsertPriority>,
pub insert_alias: Option<InsertAliases>,
pub settings: Option<Vec<Setting>>,
pub format_clause: Option<InputFormatClause>,
}
Expand description
INSERT statement.
Fields§
§or: Option<SqliteOnConflict>
Only for Sqlite
ignore: bool
Only for mysql
into: bool
INTO - optional keyword
table: TableObject
TABLE
table_alias: Option<Ident>
table_name as foo (for PostgreSQL)
columns: Vec<Ident>
COLUMNS
overwrite: bool
Overwrite (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: bool
whether the insert has the table keyword (Hive)
on: Option<OnInsert>
§returning: Option<Vec<SelectItem>>
RETURNING
replace_into: bool
Only 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}
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Insert
impl<'de> Deserialize<'de> for Insert
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Insert
impl Ord for Insert
Source§impl PartialOrd for Insert
impl PartialOrd for Insert
Source§impl VisitMut for Insert
impl VisitMut for Insert
fn visit<V: VisitorMut>(&mut self, visitor: &mut V) -> ControlFlow<V::Break>
impl Eq for Insert
impl StructuralPartialEq for Insert
Auto Trait Implementations§
impl Freeze for Insert
impl RefUnwindSafe for Insert
impl Send for Insert
impl Sync for Insert
impl Unpin for Insert
impl UnwindSafe for Insert
Blanket Implementations§
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
Mutably borrows from an owned value. Read more