BatchInsert<F extends Fields> class final

Inserts consecutive rows of the same shape together, splitting at the driver's parameter limit. All chunks share one transaction by default.

Preparing or compiling a batch performs no I/O. Inside an existing transaction, every chunk uses that transaction. A failure between chunks marks it failed, preventing a caught error from committing a partial batch.

Properties

database QueryContext
Query context that owns the batch's execution and transaction scope.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

compile() List<SqlCommand>
Returns the SQL chunks without acquiring a connection or inserting rows.
execute({ExecutionOptions options = const ExecutionOptions()}) Future<int>
Executes all chunks atomically and returns their total affected-row count.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
returning<R>(Selection<R> selection(F)) BatchReturning<R>
Prepares typed scalar projections from every inserted chunk's RETURNING.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited