FindInBatches using Offset instead of PrimaryKey iterations

This commit is contained in:
Jeff Pillou 2021-05-21 16:50:31 +02:00
parent fae7229d9e
commit 003708f020

View File

@ -167,7 +167,7 @@ func (db *DB) Find(dest interface{}, conds ...interface{}) (tx *DB) {
}
// FindInBatches find records in batches
func (db *DB) FindInBatch(dest interface{}, batchSize int, fc func(tx *DB, batch int) error) *DB {
func (db *DB) FindInBatches(dest interface{}, batchSize int, fc func(tx *DB, batch int) error) *DB {
var (
tx = db.Session(&Session{})
queryDB = tx