saveAll

open suspend override fun saveAll(group: String, checkpoints: List<Checkpoint>)

The upserts save makes one by one, as one multi-row upsert in one transaction: one statement, whose round trip also carries the transaction's bound, and one commit, one WAL flush (in autocommit each upsert of a batch was a transaction of its own). A key saved twice keeps its furthest position, as one statement may touch a row once. The rows go in key order, so two batches touching the same rows lock them in the same order and never wait on each other in a cycle; past MAX_ROWS they are split into several statements of the one transaction. A failed batch commits none of them, and the caller saves them again, as it saves any batch that failed: each upsert only moves a position forward.