- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 44 for Besson (0.44 sec)
-
tests/scan_test.go
if info.Person == nil { t.Fatalf("Failed, expected not nil, got person nil") } if info.Address == nil { t.Fatalf("Failed, expected not nil, got address nil") } if info.Person.ID == person1.ID { personMatched = true if info.Person.Name != person1.Name { t.Errorf("Failed, expected %v, got %v", person1.Name, info.Person.Name) } }
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Sat May 28 14:18:07 GMT 2022 - 8.2K bytes - Viewed (0) -
tests/transaction_test.go
if err := DB.First(&User{}, "name = ?", "transaction").Error; err == nil { t.Fatalf("Should not find record after rollback, but got %v", err) } txDB := DB.Where("fake_name = ?", "fake_name") tx2 := txDB.Session(&gorm.Session{NewDB: true}).Begin() user2 := *GetUser("transaction-2", Config{}) if err := tx2.Save(&user2).Error; err != nil { t.Fatalf("No error should raise, but got %v", err) }
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Sat Jun 10 13:05:19 GMT 2023 - 10.9K bytes - Viewed (0) -
callbacks/callmethod.go
package callbacks import ( "reflect" "gorm.io/gorm" ) func callMethod(db *gorm.DB, fc func(value interface{}, tx *gorm.DB) bool) { tx := db.Session(&gorm.Session{NewDB: true}) if called := fc(db.Statement.ReflectValue.Interface(), tx); !called { switch db.Statement.ReflectValue.Kind() { case reflect.Slice, reflect.Array: db.Statement.CurDestIndex = 0 for i := 0; i < db.Statement.ReflectValue.Len(); i++ {
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Sat Feb 18 01:20:29 GMT 2023 - 846 bytes - Viewed (0) -
tests/update_many2many_test.go
t.Fatalf("errors happened when update: %v", err) } var user3 User DB.Preload("Languages").Preload("Friends").Find(&user3, "id = ?", user.ID) CheckUser(t, user2, user3) if err := DB.Session(&gorm.Session{FullSaveAssociations: true}).Save(&user).Error; err != nil { t.Fatalf("errors happened when update: %v", err) } var user4 User DB.Preload("Languages").Preload("Friends").Find(&user4, "id = ?", user.ID)
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Thu Jan 06 07:02:53 GMT 2022 - 1.3K bytes - Viewed (0) -
tests/scanner_valuer_test.go
} } func TestGORMValuer(t *testing.T) { type UserWithPoint struct { Name string Point Point } dryRunDB := DB.Session(&gorm.Session{DryRun: true}) stmt := dryRunDB.Create(&UserWithPoint{ Name: "jinzhu", Point: Point{X: 100, Y: 100}, }).Statement if stmt.SQL.String() == "" || len(stmt.Vars) != 2 {
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Wed Jun 07 07:02:07 GMT 2023 - 10.6K bytes - Viewed (0) -
tests/update_test.go
} dryDB := DB.Session(&gorm.Session{DryRun: true}) stmt := dryDB.Save(&user).Statement if !regexp.MustCompile(`.users.\..deleted_at. IS NULL`).MatchString(stmt.SQL.String()) { t.Fatalf("invalid updating SQL, got %v", stmt.SQL.String()) } dryDB = DB.Session(&gorm.Session{DryRun: true}) stmt = dryDB.Unscoped().Save(&user).Statement
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Mon Dec 04 03:50:58 GMT 2023 - 30.3K bytes - Viewed (0) -
tests/helper_test.go
"Birthday", "CompanyID", "ManagerID", "Active") } }) } func tidbSkip(t *testing.T, reason string) { if isTiDB() { t.Skipf("This test case skipped, because of TiDB '%s'", reason) } } func isTiDB() bool { return os.Getenv("GORM_DIALECT") == "tidb" } func isMysql() bool { return os.Getenv("GORM_DIALECT") == "mysql" }
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Tue Mar 19 03:50:28 GMT 2024 - 8K bytes - Viewed (0) -
prepare_stmt.go
cacheStmt := Stmt{Transaction: isTransaction, prepared: make(chan struct{})} db.Stmts[query] = &cacheStmt db.Mux.Unlock() // prepare completed defer close(cacheStmt.prepared) // Reason why cannot lock conn.PrepareContext // suppose the maxopen is 1, g1 is creating record and g2 is querying record. // 1. g1 begin tx, g1 is requeue because of waiting for the system call, now `db.ConnPool` db.numOpen == 1.
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Thu Mar 28 08:47:39 GMT 2024 - 6.4K bytes - Viewed (0) -
callbacks/associations.go
} for i := 0; i < elemLen; i++ { appendToJoins(objs[i], elems.Index(i)) } } if joins.Len() > 0 { db.AddError(db.Session(&gorm.Session{NewDB: true}).Clauses(clause.OnConflict{DoNothing: true}).Session(&gorm.Session{ SkipHooks: db.Statement.SkipHooks, DisableNestedTransaction: true, }).Create(joins.Interface()).Error) } } } } }
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Tue Apr 11 03:06:13 GMT 2023 - 14.3K bytes - Viewed (0) -
tests/scopes_test.go
} db := DB.Scopes(func(tx *gorm.DB) *gorm.DB { return tx.Table("custom_table") }).Session(&gorm.Session{}) db.AutoMigrate(&User{}) if db.Find(&User{}).Statement.Table != "custom_table" { t.Errorf("failed to call Scopes") } result := DB.Scopes(NameIn1And2, func(tx *gorm.DB) *gorm.DB { return tx.Session(&gorm.Session{}) }).Find(&users1) if result.RowsAffected != 2 {
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Fri Jan 12 08:42:21 GMT 2024 - 3.3K bytes - Viewed (0)