- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 46 for Kappen (0.13 sec)
-
tests/create_test.go
ID uint } DB.Migrator().DropTable(&EmptyStruct{}) if err := DB.AutoMigrate(&EmptyStruct{}); err != nil { t.Errorf("no error should happen when auto migrate, but got %v", err) } if err := DB.Create(&EmptyStruct{}).Error; err != nil { t.Errorf("No error should happen when creating user, but got %v", err) } } func TestCreateEmptySlice(t *testing.T) { data := []User{}
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Tue Mar 19 03:50:28 GMT 2024 - 26.4K bytes - Viewed (0) -
tests/embedded_struct_test.go
t.Errorf("no error should happen when query with embedded struct, but got %v", err) } else if egNews.BasePost.Title != "engadget_news" { t.Errorf("embedded struct's value should be scanned correctly") } var egPosts []EngadgetPost if err := DB.Order("author_name asc").Find(&egPosts).Error; err != nil { t.Fatalf("no error should happen when query with embedded struct, but got %v", err) }
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Thu Oct 26 03:58:13 GMT 2023 - 7.3K bytes - Viewed (0) -
tests/prepared_stmt_test.go
txCtx.Create(&user) var result1 User if err := txCtx.Find(&result1, user.ID).Error; err != nil { t.Fatalf("no error should happen but got %v", err) } time.Sleep(time.Second) var result2 User if err := tx.Find(&result2, user.ID).Error; err != nil { t.Fatalf("no error should happen but got %v", err) } user2 := *GetUser("prepared_stmt2", Config{}) if err := txCtx.Create(&user2).Error; err == nil {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Thu Mar 21 07:55:43 GMT 2024 - 4K bytes - Viewed (0) -
tests/associations_has_many_test.go
} // Append DB.Model(&users).Association("Pets").Append( &Pet{Name: "pet-slice-append-1"}, []*Pet{{Name: "pet-slice-append-2-1"}, {Name: "pet-slice-append-2-2"}}, &Pet{Name: "pet-slice-append-3"}, ) AssertAssociationCount(t, users, "Pets", 10, "After Append") // Replace -> same as append DB.Model(&users).Association("Pets").Replace(
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Dec 15 08:36:08 GMT 2023 - 15.6K bytes - Viewed (0) -
callbacks.go
if curIdx := getRIndex(sorted, c.name); curIdx == -1 { // if before callback already sorted, append current callback just after it sorted = append(sorted[:sortedIdx], append([]string{c.name}, sorted[sortedIdx:]...)...) } else if curIdx > sortedIdx { return fmt.Errorf("conflicting callback %s with before %s", c.name, c.before) } } else if idx := getRIndex(names, c.before); idx != -1 { // if before callback exists
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Tue Mar 26 03:33:36 GMT 2024 - 8.6K bytes - Viewed (1) -
tests/joins_test.go
*GetUser("slice-joins-3", Config{Company: true, Manager: true, Account: true}), } DB.Create(&users) var userIDs []uint for _, user := range users { userIDs = append(userIDs, user.ID) } var users2 []User if err := DB.Joins("Company").Joins("Manager").Joins("Account").Find(&users2, "users.id IN ?", userIDs).Error; err != nil { t.Fatalf("Failed to load with joins, got error: %v", err)
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Wed Apr 26 14:19:32 GMT 2023 - 13.5K bytes - Viewed (1) -
tests/connpool_test.go
} func (c *wrapperTx) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error) { c.conn.got = append(c.conn.got, query) return c.Tx.PrepareContext(ctx, query) } func (c *wrapperTx) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) { c.conn.got = append(c.conn.got, query) return c.Tx.ExecContext(ctx, query, args...) }
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Tue Feb 06 02:54:40 GMT 2024 - 5.5K bytes - Viewed (0) -
tests/soft_delete_test.go
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Wed Feb 01 06:40:55 GMT 2023 - 5.7K bytes - Viewed (0) -
scan.go
// nested relation fields relFields := make([]*schema.Field, 0, subNameCount-1) relFields = append(relFields, rel.Field) for _, name := range names[1 : subNameCount-1] { rel = rel.FieldSchema.Relationships.Relations[name] relFields = append(relFields, rel.Field) } // lastest name is raw dbname dbName := names[subNameCount-1]
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Apr 26 09:53:11 GMT 2024 - 9.8K bytes - Viewed (0) -
tests/count_test.go
t.Fatalf("Count should be 3, but got count: %v err %v", count10, err) } var count11 int64 sameUsers := make([]*User, 0) for i := 0; i < 3; i++ { sameUsers = append(sameUsers, GetUser("count-4", Config{})) } DB.Create(sameUsers) if err := DB.Model(&User{}).Where("name = ?", "count-4").Group("name").Count(&count11).Error; err != nil || count11 != 1 {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Oct 30 09:15:49 GMT 2023 - 6.9K bytes - Viewed (0)