MCPcopy
hub / github.com/go-gorm/gorm / FindInBatches

Method FindInBatches

generics.go:658–663  ·  view source on GitHub ↗
(ctx context.Context, batchSize int, fc func(data []T, batch int) error)

Source from the content-addressed store, hash-verified

656}
657
658func (g execG[T]) FindInBatches(ctx context.Context, batchSize int, fc func(data []T, batch int) error) error {
659 var data []T
660 return g.g.apply(ctx).FindInBatches(&data, batchSize, func(tx *DB, batch int) error {
661 return fc(data, batch)
662 }).Error
663}
664
665func (g execG[T]) Row(ctx context.Context) *sql.Row {
666 var r T

Callers

nothing calls this directly

Calls 2

applyMethod · 0.80
FindInBatchesMethod · 0.65

Tested by

no test coverage detected