- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 28 for RowsAffected (0.18 sec)
-
tests/tracer_test.go
package tests_test import ( "context" "time" "gorm.io/gorm/logger" ) type Tracer struct { Logger logger.Interface Test func(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error) } func (S Tracer) LogMode(level logger.LogLevel) logger.Interface { return S.Logger.LogMode(level) } func (S Tracer) Info(ctx context.Context, s string, i ...interface{}) {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Tue Oct 18 09:28:06 UTC 2022 - 830 bytes - Viewed (0) -
tests/gorm_test.go
} else if results.RowsAffected != 1 { t.Fatalf("rows affected expects: %v, got %v", 1, results.RowsAffected) } else if u1.ID == 0 { t.Fatalf("ID expects : not equal 0, got %v", u1.ID) } got := user{} results := DB.First(&got, "id = ?", u1.ID) if results.Error != nil { t.Fatalf("errors happened on first: %v", results.Error) } else if results.RowsAffected != 1 {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Thu Jun 01 07:22:21 UTC 2023 - 3.3K bytes - Viewed (0) -
finisher_api.go
rowsAffected += result.RowsAffected batch++ if result.Error == nil && result.RowsAffected != 0 { fcTx := result.Session(&Session{NewDB: true}) fcTx.RowsAffected = result.RowsAffected tx.AddError(fc(fcTx, batch)) } else if result.Error != nil { tx.AddError(result.Error) } if tx.Error != nil || int(result.RowsAffected) < batchSize { break }
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Sat Sep 14 12:58:29 UTC 2024 - 22.8K bytes - Viewed (0) -
tests/prepared_stmt_test.go
t.Fatalf("Failed, got error: %v, rows affected: %v", result.Error, result.RowsAffected) } tx2 := db.Begin() if result := tx2.Where("name=?", "zzjin").Delete(&User{}); result.Error != nil || result.RowsAffected != 0 { t.Fatalf("Failed, got error: %v, rows affected: %v", result.Error, result.RowsAffected) } tx2.Commit() }
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Thu Aug 22 11:02:05 UTC 2024 - 8.5K bytes - Viewed (0) -
scan.go
BEGIN: initialized = false if update { if int(db.RowsAffected) >= reflectValue.Len() { return } elem = reflectValue.Index(int(db.RowsAffected)) if onConflictDonothing { for _, field := range fields { if _, ok := field.ValueOf(db.Statement.Context, elem); !ok { db.RowsAffected++ goto BEGIN } } } } else {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Jun 24 09:42:59 UTC 2024 - 10.1K bytes - Viewed (0) -
tests/update_test.go
} if rowsAffected := DB.Model([]User{result4}).Where("age > 0").Update("name", "jinzhu").RowsAffected; rowsAffected != 1 { t.Errorf("should only update one record, but got %v", rowsAffected) } if rowsAffected := DB.Model(users).Where("age > 0").Update("name", "jinzhu").RowsAffected; rowsAffected != 3 { t.Errorf("should only update one record, but got %v", rowsAffected) } }
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Dec 04 03:50:58 UTC 2023 - 30.3K bytes - Viewed (0) -
callbacks/raw.go
result, err := db.Statement.ConnPool.ExecContext(db.Statement.Context, db.Statement.SQL.String(), db.Statement.Vars...) if err != nil { db.AddError(err) return } db.RowsAffected, _ = result.RowsAffected() }
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Nov 29 01:33:20 UTC 2021 - 336 bytes - Viewed (0) -
tests/non_std_test.go
t.Errorf("UpdatedAt should be updated") } var animals []Animal DB.Find(&animals) if count := DB.Model(Animal{}).Where("1=1").Update("CreatedAt", time.Now().Add(2*time.Hour)).RowsAffected; count != int64(len(animals)) { t.Error("RowsAffected should be correct when do batch update") } animal = Animal{From: "somewhere"} // No name fields, should be filled with the default value (galeone)
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed May 08 04:07:58 UTC 2024 - 1.9K bytes - Viewed (0) -
tests/create_test.go
if res.Error != nil || res.RowsAffected != 1 { t.Fatalf("first or create rows affect err:%v rows:%d", res.Error, res.RowsAffected) } res = DB.FirstOrCreate(&user, "name = ?", user.Name) if res.Error != nil || res.RowsAffected != 0 { t.Fatalf("first or create rows affect err:%v rows:%d", res.Error, res.RowsAffected) } }
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Tue Mar 19 03:50:28 UTC 2024 - 26.4K bytes - Viewed (0) -
tests/joins_table_test.go
t.Fatalf("Failed to delete address, got error %v", err) } if len(person.Addresses) != 1 { t.Fatalf("Should have one address left") } if DB.Find(&[]PersonAddress{}, "person_id = ?", person.ID).RowsAffected != 1 { t.Fatalf("Should found one address") } var addresses2 []Address if err := DB.Model(&person).Association("Addresses").Find(&addresses2); err != nil || len(addresses2) != 1 {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Thu Sep 10 13:46:18 UTC 2020 - 3.5K bytes - Viewed (0)