pub struct InsertManyBuilder<'a, M: Model> { /* private fields */ }Expand description
Implementations§
Source§impl<'a, M: Model> InsertManyBuilder<'a, M>
impl<'a, M: Model> InsertManyBuilder<'a, M>
Sourcepub fn new(models: &'a [M]) -> Self
pub fn new(models: &'a [M]) -> Self
Create a new bulk INSERT builder for the given model instances.
Sourcepub fn on_conflict_do_nothing(self) -> Self
pub fn on_conflict_do_nothing(self) -> Self
Handle conflicts by doing nothing.
Sourcepub fn on_conflict_do_update(self, columns: &[&str]) -> Self
pub fn on_conflict_do_update(self, columns: &[&str]) -> Self
Handle conflicts by updating specified columns.
Sourcepub fn build(&self) -> (String, Vec<Value>)
pub fn build(&self) -> (String, Vec<Value>)
Build the bulk INSERT SQL and parameters with default dialect.
Sourcepub fn build_with_dialect(&self, dialect: Dialect) -> (String, Vec<Value>)
pub fn build_with_dialect(&self, dialect: Dialect) -> (String, Vec<Value>)
Build the bulk INSERT SQL and parameters with specific dialect.
Sourcepub async fn execute<C: Connection>(
self,
cx: &Cx,
conn: &C,
) -> Outcome<u64, Error>
pub async fn execute<C: Connection>( self, cx: &Cx, conn: &C, ) -> Outcome<u64, Error>
Execute the bulk INSERT and return rows affected.
Sourcepub async fn execute_returning<C: Connection>(
self,
cx: &Cx,
conn: &C,
) -> Outcome<Vec<Row>, Error>
pub async fn execute_returning<C: Connection>( self, cx: &Cx, conn: &C, ) -> Outcome<Vec<Row>, Error>
Execute the bulk INSERT with RETURNING and get the inserted rows.
Trait Implementations§
Auto Trait Implementations§
impl<'a, M> Freeze for InsertManyBuilder<'a, M>
impl<'a, M> RefUnwindSafe for InsertManyBuilder<'a, M>where
M: RefUnwindSafe,
impl<'a, M> Send for InsertManyBuilder<'a, M>
impl<'a, M> Sync for InsertManyBuilder<'a, M>
impl<'a, M> Unpin for InsertManyBuilder<'a, M>
impl<'a, M> UnwindSafe for InsertManyBuilder<'a, M>where
M: RefUnwindSafe,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).