Zum Inhalt springen

Missing Bulk Operation (ARCH5053)

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Key go.orm.missing-bulk-operation · Severity warning · Category orm

Inserting rows one at a time in a loop when a bulk API like CreateInBatches exists wastes round-trips. Collapse to a single bulk call.

for _, p := range products {
db.Create(&p)
}
db.CreateInBatches(products, 200)

Merge per-iteration insert/update calls into a bulk API such as CreateInBatches.