pub struct CreateManyOperation<E: QueryEngine, M: Model> { /* private fields */ }Expand description
Create many records at once.
Implementations§
Source§impl<E: QueryEngine, M: Model> CreateManyOperation<E, M>
impl<E: QueryEngine, M: Model> CreateManyOperation<E, M>
Sourcepub fn columns(
self,
columns: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn columns( self, columns: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Set the columns for insertion.
Sourcepub fn row(
self,
values: impl IntoIterator<Item = impl Into<FilterValue>>,
) -> Self
pub fn row( self, values: impl IntoIterator<Item = impl Into<FilterValue>>, ) -> Self
Add a row of values.
Sourcepub fn rows(
self,
rows: impl IntoIterator<Item = impl IntoIterator<Item = impl Into<FilterValue>>>,
) -> Self
pub fn rows( self, rows: impl IntoIterator<Item = impl IntoIterator<Item = impl Into<FilterValue>>>, ) -> Self
Add multiple rows.
Sourcepub fn skip_duplicates(self) -> Self
pub fn skip_duplicates(self) -> Self
Skip records that violate unique constraints.
Sourcepub fn build_sql(&self) -> (String, Vec<FilterValue>)
pub fn build_sql(&self) -> (String, Vec<FilterValue>)
Build the SQL query.
Sourcepub async fn exec(self) -> QueryResult<u64>
pub async fn exec(self) -> QueryResult<u64>
Execute the create operation and return the number of created records.
Auto Trait Implementations§
impl<E, M> Freeze for CreateManyOperation<E, M>where
E: Freeze,
impl<E, M> RefUnwindSafe for CreateManyOperation<E, M>where
E: RefUnwindSafe,
M: RefUnwindSafe,
impl<E, M> Send for CreateManyOperation<E, M>
impl<E, M> Sync for CreateManyOperation<E, M>
impl<E, M> Unpin for CreateManyOperation<E, M>
impl<E, M> UnwindSafe for CreateManyOperation<E, M>where
E: UnwindSafe,
M: UnwindSafe,
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