- Sort Score
- Result 10 results
- Languages All
Results 1 - 4 of 4 for CreateInBatches (0.06 sec)
-
tests/generics_test.go
{Name: "GenericsCreateInBatches1"}, {Name: "GenericsCreateInBatches2"}, {Name: "GenericsCreateInBatches3"}, } ctx := context.Background() if err := gorm.G[User](DB).CreateInBatches(ctx, &batch, 2); err != nil { t.Fatalf("CreateInBatches failed: %v", err) } for _, u := range batch { if u.ID == 0 { t.Fatalf("no primary key found for %v", u) } }Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Sep 04 13:13:16 UTC 2025 - 28K bytes - Viewed (0) -
generics.go
})} } func (c createG[T]) Create(ctx context.Context, r *T) error { return c.g.apply(ctx).Create(r).Error } func (c createG[T]) CreateInBatches(ctx context.Context, r *[]T, batchSize int) error { return c.g.apply(ctx).CreateInBatches(r, batchSize).Error } type chainG[T any] struct { execG[T] } func (c chainG[T]) getInstance() *DB { var r T
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Sep 04 13:13:16 UTC 2025 - 15.5K bytes - Viewed (0) -
finisher_api.go
func (db *DB) Create(value interface{}) (tx *DB) { if db.CreateBatchSize > 0 { return db.CreateInBatches(value, db.CreateBatchSize) } tx = db.getInstance() tx.Statement.Dest = value return tx.callbacks.Create().Execute(tx) } // CreateInBatches inserts value in batches of batchSize func (db *DB) CreateInBatches(value interface{}, batchSize int) (tx *DB) { reflectValue := reflect.Indirect(reflect.ValueOf(value))
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Tue Aug 26 06:24:29 UTC 2025 - 22.9K bytes - Viewed (0) -
tests/upsert_test.go
langs[idx] = lang } if err := DB.Clauses(clause.OnConflict{ Columns: []clause.Column{{Name: "code"}}, DoUpdates: clause.AssignmentColumns([]string{"name"}), }, clause.Returning{}).CreateInBatches(&langs, len(langs)).Error; err != nil { t.Fatalf("failed to upsert, got %v", err) } for _, lang := range langs { var results []Language
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Tue Jul 29 11:06:13 UTC 2025 - 13.1K bytes - Viewed (0)