Batchlight

batchlight / co.yello.db.batchlight / BatchStatement

BatchStatement

class BatchStatement<T>

Drives the inserts into the database.

Parameters

T - The type of the collection that will be inserted. This is used to pass into the bind function that is passed into the execute function.

Constructors

Name Summary
<init> BatchStatement(binderConfig: BinderConfig)
Drives the inserts into the database.

Functions

Name Summary
execute fun execute(itemsToInsert: Collection<T>, bindItemFunction: BatchBinder.(T) -> Unit): Unit
Chunks the list into the maximum sized list that can be inserted at a time, then executes the insert with the bindItemFunction passed into the class.