pub struct InsertStmt {
pub table: SchemaRef,
pub columns: Option<Vec<String>>,
pub source: InsertSource,
pub on_conflict: Option<Vec<OnConflictDef>>,
pub returning: Option<Vec<SelectColumn>>,
pub ctes: Option<Vec<CteDef>>,
pub overriding: Option<OverridingKind>,
pub conflict_resolution: Option<ConflictResolution>,
pub partition: Option<Vec<String>>,
pub ignore: bool,
}Expand description
INSERT INTO … VALUES / SELECT / DEFAULT VALUES.
Fields§
§table: SchemaRef§columns: Option<Vec<String>>§source: InsertSource§on_conflict: Option<Vec<OnConflictDef>>Multiple ON CONFLICT clauses (SQLite processes in order; last may omit target).
returning: Option<Vec<SelectColumn>>§ctes: Option<Vec<CteDef>>§overriding: Option<OverridingKind>PG: OVERRIDING { SYSTEM | USER } VALUE (for identity columns).
conflict_resolution: Option<ConflictResolution>SQLite: INSERT OR REPLACE / OR IGNORE / OR ABORT / etc.
partition: Option<Vec<String>>MySQL/Oracle: PARTITION targeting.
ignore: boolMySQL: IGNORE modifier (downgrades errors to warnings).
Implementations§
Source§impl InsertStmt
impl InsertStmt
pub fn values(table: &str, columns: Vec<&str>, rows: Vec<Vec<Expr>>) -> Self
pub fn from_select(table: &str, columns: Vec<&str>, query: QueryStmt) -> Self
pub fn default_values(table: &str) -> Self
pub fn returning(self, cols: Vec<SelectColumn>) -> Self
pub fn on_conflict(self, def: OnConflictDef) -> Self
Trait Implementations§
Source§impl Clone for InsertStmt
impl Clone for InsertStmt
Source§fn clone(&self) -> InsertStmt
fn clone(&self) -> InsertStmt
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InsertStmt
impl Debug for InsertStmt
Auto Trait Implementations§
impl Freeze for InsertStmt
impl !RefUnwindSafe for InsertStmt
impl Send for InsertStmt
impl Sync for InsertStmt
impl Unpin for InsertStmt
impl UnsafeUnpin for InsertStmt
impl !UnwindSafe for InsertStmt
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