- Sort Score
- Result 10 results
- Languages All
Results 1 - 5 of 5 for FindInBatches (0.16 sec)
-
README.md
* Eager loading with `Preload`, `Joins` * Transactions, Nested Transactions, Save Point, RollbackTo to Saved Point * Context, Prepared Statement Mode, DryRun Mode * Batch Insert, FindInBatches, Find To Map * SQL Builder, Upsert, Locking, Optimizer/Index/Comment Hints, NamedArg, Search/Update/Create with SQL Expr * Composite Primary Key * Auto Migrations * Logger
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Tue Nov 07 02:20:06 UTC 2023 - 1.8K bytes - Viewed (0) -
generics.go
func (g execG[T]) Find(ctx context.Context) ([]T, error) { var r []T err := g.g.apply(ctx).Find(&r).Error return r, err } func (g execG[T]) FindInBatches(ctx context.Context, batchSize int, fc func(data []T, batch int) error) error { var data []T return g.g.apply(ctx).FindInBatches(&data, batchSize, func(tx *DB, batch int) error { return fc(data, batch) }).Error } func (g execG[T]) Row(ctx context.Context) *sql.Row {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Sep 04 13:13:16 UTC 2025 - 15.5K bytes - Viewed (0) -
tests/query_test.go
return nil }); result.Error != nil || result.RowsAffected != 5 { t.Errorf("Failed to batch find, got error %v, rows affected: %v", result.Error, result.RowsAffected) } var sub2 []User // only offset if result := DB.Offset(3).Where("name = ?", users[0].Name).FindInBatches(&sub2, 2, func(tx *gorm.DB, batch int) error {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Tue Jul 22 06:21:04 UTC 2025 - 51K bytes - Viewed (0) -
tests/generics_test.go
} total := 0 err := gorm.G[User](DB).Where("name like ?", "GenericsFindBatch%").FindInBatches(ctx, 2, func(chunk []User, batch int) error { if len(chunk) > 2 { t.Errorf("batch size exceed 2: got %d", len(chunk)) } total += len(chunk) return nil }) if err != nil { t.Fatalf("FindInBatches failed: %v", err) } if total != len(users) {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Sep 04 13:13:16 UTC 2025 - 28K bytes - Viewed (0) -
finisher_api.go
tx.Statement.AddClause(clause.Where{Exprs: exprs}) } } tx.Statement.Dest = dest return tx.callbacks.Query().Execute(tx) } // FindInBatches finds all records in batches of batchSize func (db *DB) FindInBatches(dest interface{}, batchSize int, fc func(tx *DB, batch int) error) *DB { var ( tx = db.Order(clause.OrderByColumn{
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Tue Aug 26 06:24:29 UTC 2025 - 22.9K bytes - Viewed (0)