- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 60 for results (0.15 sec)
-
tests/create_test.go
} var result2 User if err := DB.Where("name = ?", "create_from_map_2").First(&result2).Error; err != nil || result2.Age != 19 { t.Fatalf("failed to query data after create from slice of map, got error %v", err) } var result3 User if err := DB.Where("name = ?", "create_from_map_3").First(&result3).Error; err != nil || result3.Age != 20 {
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/joins_test.go
return results[i].PetID > results[j].PetID }) sort.Slice(results, func(i, j int) bool { return user.Pets[i].ID > user.Pets[j].ID }) if len(results) != 2 || results[0].Name != user.Pets[0].Name || results[1].Name != user.Pets[1].Name { t.Errorf("Should find all two pets with Join select, got %+v", results) } } func TestJoinWithOmit(t *testing.T) { user := *GetUser("joins_with_omit", Config{Pets: 2})
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) -
clause/values_test.go
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Thu Jan 06 07:02:53 GMT 2022 - 691 bytes - Viewed (0) -
clause/set_test.go
}, "UPDATE `users` SET `name`=?", []interface{}{"jinzhu"}, }, } for idx, result := range results { t.Run(fmt.Sprintf("case #%v", idx), func(t *testing.T) { checkBuildClauses(t, result.Clauses, result.Result, result.Vars) }) } } func TestAssignments(t *testing.T) { set := clause.Assignments(map[string]interface{}{ "name": "jinzhu", "age": 18,
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Thu Jan 06 07:02:53 GMT 2022 - 1.4K bytes - Viewed (0) -
tests/callbacks_test.go
} datas := []struct { callbacks []callback err string results []string }{ { callbacks: []callback{{h: c1}, {h: c2}, {h: c3}, {h: c4}, {h: c5}}, results: []string{"c1", "c2", "c3", "c4", "c5"}, }, { callbacks: []callback{{h: c1}, {h: c2}, {h: c3}, {h: c4}, {h: c5, before: "c4"}}, results: []string{"c1", "c2", "c3", "c5", "c4"}, }, {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Tue Mar 26 03:33:36 GMT 2024 - 7.2K bytes - Viewed (0) -
utils/utils.go
} func ToStringKey(values ...interface{}) string { results := make([]string, len(values)) for idx, value := range values { if valuer, ok := value.(driver.Valuer); ok { value, _ = valuer.Value() } switch v := value.(type) { case string: results[idx] = v case []byte: results[idx] = string(v) case uint: results[idx] = strconv.FormatUint(uint64(v), 10) default:
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Apr 22 06:43:02 GMT 2024 - 3.8K bytes - Viewed (0) -
tests/distinct_test.go
{Name: "distinct-2", Age: 18}, {Name: "distinct-3", Age: 18}, } if len(results) != 4 { t.Fatalf("invalid results length found, expects: %v, got %v", len(expects), len(results)) } for idx, expect := range expects { AssertObjEqual(t, results[idx], expect, "Name", "Age") } var count int64 if err := DB.Model(&User{}).Where("name like ?", "distinct%").Count(&count).Error; err != nil || count != 5 {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Thu Jan 06 07:02:53 GMT 2022 - 2.5K bytes - Viewed (0) -
tests/gorm_test.go
t.Fatalf("errors happened on first: %v", results.Error) } else if results.RowsAffected != 1 { t.Fatalf("rows affected expects: %v, got %v", 1, results.RowsAffected) } else if got.ID != u1.ID { t.Fatalf("first expects: %v, got %v", u1, got) } results = DB.Select("id, name").Find(&got) if results.Error != nil { t.Fatalf("errors happened on first: %v", results.Error) } else if results.RowsAffected != 1 {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Thu Jun 01 07:22:21 GMT 2023 - 3.3K bytes - Viewed (0) -
clause/select_test.go
}, }, }, }, clause.From{}}, "SELECT `age` = ? as name FROM `users`", []interface{}{18}, }, } for idx, result := range results { t.Run(fmt.Sprintf("case #%v", idx), func(t *testing.T) { checkBuildClauses(t, result.Clauses, result.Result, result.Vars) }) }
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Sat Feb 18 01:06:43 GMT 2023 - 1.7K bytes - Viewed (0) -
tests/upsert_test.go
} for _, lang := range langs { var results []Language if err := DB.Find(&results, "code = ?", lang.Code).Error; err != nil { t.Errorf("no error should happen when find languages with code, but got %v", err) } else if len(results) != 1 { t.Errorf("should only find only 1 languages, but got %+v", langs) } else if results[0].Name != lang.Name {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Sep 05 07:39:19 GMT 2022 - 11.4K bytes - Viewed (0)