pub struct BulkInsertBuilder { /* private fields */ }Expand description
Builder for configuring a bulk insert operation.
Implementations§
Source§impl BulkInsertBuilder
impl BulkInsertBuilder
Sourcepub fn new<S: Into<String>>(table_name: S) -> Self
pub fn new<S: Into<String>>(table_name: S) -> Self
Create a new bulk insert builder for the specified table.
Sourcepub fn with_columns(self, column_names: &[&str]) -> Self
pub fn with_columns(self, column_names: &[&str]) -> Self
Specify the columns to insert.
Columns will be queried from the server if not specified, but providing them explicitly is more efficient.
Sourcepub fn with_typed_columns(self, columns: Vec<BulkColumn>) -> Self
pub fn with_typed_columns(self, columns: Vec<BulkColumn>) -> Self
Specify columns with full type information.
Sourcepub fn with_options(self, options: BulkOptions) -> Self
pub fn with_options(self, options: BulkOptions) -> Self
Set bulk insert options.
Sourcepub fn batch_size(self, size: usize) -> Self
pub fn batch_size(self, size: usize) -> Self
Set the batch size.
Sourcepub fn table_lock(self, enabled: bool) -> Self
pub fn table_lock(self, enabled: bool) -> Self
Enable or disable table lock.
Sourcepub fn fire_triggers(self, enabled: bool) -> Self
pub fn fire_triggers(self, enabled: bool) -> Self
Enable or disable trigger firing.
Sourcepub fn table_name(&self) -> &str
pub fn table_name(&self) -> &str
Get the table name.
Sourcepub fn columns(&self) -> &[BulkColumn]
pub fn columns(&self) -> &[BulkColumn]
Get the columns.
Sourcepub fn options(&self) -> &BulkOptions
pub fn options(&self) -> &BulkOptions
Get the options.
Sourcepub fn build_insert_bulk_statement(&self) -> String
pub fn build_insert_bulk_statement(&self) -> String
Build the INSERT BULK SQL statement.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BulkInsertBuilder
impl RefUnwindSafe for BulkInsertBuilder
impl Send for BulkInsertBuilder
impl Sync for BulkInsertBuilder
impl Unpin for BulkInsertBuilder
impl UnwindSafe for BulkInsertBuilder
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