pub struct InsertBuilder { /* private fields */ }Expand description
Fluent builder for constructing INSERT INTO statements.
Created by the insert_into() entry-point function. Supports specifying target
columns via .columns(), row values via
.values() (can be called multiple times for multiple rows),
and INSERT … SELECT via .query().
Implementations§
Source§impl InsertBuilder
impl InsertBuilder
Sourcepub fn columns<I, S>(self, columns: I) -> Self
pub fn columns<I, S>(self, columns: I) -> Self
Set the target column names for the INSERT statement.
Sourcepub fn values<I>(self, values: I) -> Selfwhere
I: IntoIterator<Item = Expr>,
pub fn values<I>(self, values: I) -> Selfwhere
I: IntoIterator<Item = Expr>,
Append a row of values to the VALUES clause.
Call this method multiple times to insert multiple rows in a single statement.
Sourcepub fn query(self, query: SelectBuilder) -> Self
pub fn query(self, query: SelectBuilder) -> Self
Set the source query for an INSERT INTO ... SELECT ... statement.
When a query is set, the VALUES clause is ignored during generation.
Sourcepub fn build(self) -> Expression
pub fn build(self) -> Expression
Consume this builder and produce the final Expression::Insert AST node.
Auto Trait Implementations§
impl Freeze for InsertBuilder
impl RefUnwindSafe for InsertBuilder
impl Send for InsertBuilder
impl Sync for InsertBuilder
impl Unpin for InsertBuilder
impl UnwindSafe for InsertBuilder
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