pub struct Batch { /* private fields */ }Expand description
A batch of operations to execute together.
Implementations§
Source§impl Batch
impl Batch
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a batch with pre-allocated capacity.
Sourcepub fn add(&mut self, op: BatchOperation)
pub fn add(&mut self, op: BatchOperation)
Add an operation to the batch.
Sourcepub fn operations(&self) -> &[BatchOperation]
pub fn operations(&self) -> &[BatchOperation]
Get the operations in the batch.
Sourcepub fn to_combined_sql(
&self,
db_type: DatabaseType,
) -> Option<(String, Vec<FilterValue>)>
pub fn to_combined_sql( &self, db_type: DatabaseType, ) -> Option<(String, Vec<FilterValue>)>
Convert the batch to a single SQL statement for databases that support it.
This combines multiple INSERT statements into a single multi-row INSERT.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Batch
impl RefUnwindSafe for Batch
impl Send for Batch
impl Sync for Batch
impl Unpin for Batch
impl UnwindSafe for Batch
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