pub struct InsertStmt {
pub table: TableName,
pub columns: Vec<ColumnName>,
pub values: Vec<Expr>,
pub on_conflict: Option<OnConflict>,
pub returning: Vec<ColumnName>,
}Expand description
An INSERT statement.
Fields§
§table: TableNameThe table to insert into.
columns: Vec<ColumnName>Column names for the insert.
values: Vec<Expr>Values to insert (parallel to columns).
on_conflict: Option<OnConflict>Optional ON CONFLICT clause for upsert behavior.
returning: Vec<ColumnName>Columns to return after insert (RETURNING clause).
Implementations§
Source§impl InsertStmt
impl InsertStmt
pub fn new(table: TableName) -> Self
pub fn column(self, name: ColumnName, value: Expr) -> Self
pub fn on_conflict(self, conflict: OnConflict) -> Self
pub fn returning(self, cols: impl IntoIterator<Item = ColumnName>) -> 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 (const: unstable) · 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
Source§impl Render for InsertStmt
impl Render 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