pub struct BulkOptions {
pub batch_size: usize,
pub check_constraints: bool,
pub fire_triggers: bool,
pub keep_nulls: bool,
pub table_lock: bool,
pub order_hint: Option<Vec<String>>,
}Expand description
Options controlling bulk insert behavior.
These options map to SQL Server’s BULK INSERT hints and affect performance, logging, and constraint checking.
Fields§
§batch_size: usizeRows-per-batch hint sent to the server.
When non-zero this is emitted as the ROWS_PER_BATCH hint on the
INSERT BULK statement, which helps the server pick a query plan.
It does not change client-side behavior: BulkWriter buffers
all rows in memory and sends them as a single batch on
finish(). Incremental flushing is planned
alongside the response-streaming work.
Default: 0 (no hint).
check_constraints: boolCheck constraints during insert.
Default: true
fire_triggers: boolFire INSERT triggers on the table.
Default: false (better performance)
keep_nulls: boolKeep NULL values instead of using column defaults.
Default: true
table_lock: boolAcquire a table-level lock for the duration of the bulk operation.
This can significantly improve performance by reducing lock escalation overhead, but blocks all other access to the table. Default: false
order_hint: Option<Vec<String>>Order hint for the data being inserted.
If data is pre-sorted by the clustered index, specify the columns here to avoid a sort operation on the server. Default: None
Trait Implementations§
Source§impl Clone for BulkOptions
impl Clone for BulkOptions
Source§fn clone(&self) -> BulkOptions
fn clone(&self) -> BulkOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more