- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 28 for mount (0.16 sec)
-
tests/associations_has_one_test.go
*GetUser("slice-hasone-3", Config{Account: true}), } DB.Create(&users) // Count AssertAssociationCount(t, users, "Account", 2, "") // Find var accounts []Account if DB.Model(&users).Association("Account").Find(&accounts); len(accounts) != 2 { t.Errorf("accounts count should be %v, but got %v", 3, len(accounts)) } // Append DB.Model(&users).Association("Account").Append(
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Thu Jan 06 07:02:53 GMT 2022 - 6.8K bytes - Viewed (0) -
tests/distinct_test.go
} var count int64 if err := DB.Model(&User{}).Where("name like ?", "distinct%").Count(&count).Error; err != nil || count != 5 { t.Errorf("failed to query users count, got error: %v, count: %v", err, count) } if err := DB.Model(&User{}).Distinct("name").Where("name like ?", "distinct%").Count(&count).Error; err != nil || count != 3 { t.Errorf("failed to query users count, got error: %v, count %v", err, count) }
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Thu Jan 06 07:02:53 GMT 2022 - 2.5K bytes - Viewed (0) -
chainable_api.go
clause.Expression = nil tx.Statement.Clauses["SELECT"] = clause } case string: if strings.Count(v, "?") >= len(args) && len(args) > 0 { tx.Statement.AddClause(clause.Select{ Distinct: db.Statement.Distinct, Expression: clause.Expr{SQL: v, Vars: args}, }) } else if strings.Count(v, "@") > 0 && len(args) > 0 { tx.Statement.AddClause(clause.Select{ Distinct: db.Statement.Distinct,
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Wed Apr 17 03:38:55 GMT 2024 - 14.3K bytes - Viewed (1) -
migrator/migrator.go
func (m Migrator) HasTable(value interface{}) bool { var count int64 m.RunWithValue(value, func(stmt *gorm.Statement) error { currentDatabase := m.DB.Migrator().CurrentDatabase() return m.DB.Raw("SELECT count(*) FROM information_schema.tables WHERE table_schema = ? AND table_name = ? AND table_type = ?", currentDatabase, stmt.Table, "BASE TABLE").Row().Scan(&count) }) return count > 0 }
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Fri Apr 26 07:15:49 GMT 2024 - 29K bytes - Viewed (0) -
schema/schema_helper_test.go
if len(relations.Relations) != len(rs.Relations) { t.Errorf("schema relations count don't match, expects %d, got %d", len(rs.Relations), len(relations.Relations)) } if len(relations.EmbeddedRelations) != len(rs.EmbeddedRelations) { t.Errorf("schema embedded relations count don't match, expects %d, got %d", len(rs.EmbeddedRelations), len(relations.EmbeddedRelations)) }
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Fri Dec 15 08:31:23 GMT 2023 - 7.5K bytes - Viewed (0) -
utils/tests/models.go
type Coupon struct { ID int `gorm:"primarykey; size:255"` AppliesToProduct []*CouponProduct `gorm:"foreignKey:CouponId;constraint:OnDelete:CASCADE"` AmountOff uint32 `gorm:"column:amount_off"` PercentOff float32 `gorm:"column:percent_off"` } type CouponProduct struct { CouponId int `gorm:"primarykey;size:255"` ProductId string `gorm:"primarykey;size:255"` Desc string }
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Fri Dec 15 08:36:08 GMT 2023 - 2.1K bytes - Viewed (0) -
tests/delete_test.go
if count := DB.Unscoped().Model(&user).Association(key).Count(); count != value { t.Errorf("user's %v expects: %v, got %v", key, value, count) } } for key, value := range map[string]int64{"Account": 0, "Pets": 0, "Toys": 0, "Company": 1, "Manager": 1, "Team": 0, "Languages": 0, "Friends": 0} { if count := DB.Model(&user).Association(key).Count(); count != value {
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Tue Oct 10 07:03:34 GMT 2023 - 9.4K bytes - Viewed (0) -
tests/named_polymorphic_test.go
} // clear to omit Toy.ID in count hamster2.PreferredToy = Toy{} hamster2.OtherToy = Toy{} if DB.Model(&hamster2).Association("PreferredToy").Count() != 1 { t.Errorf("Hamster's preferred toy count should be 1") } if DB.Model(&hamster2).Association("OtherToy").Count() != 1 { t.Errorf("Hamster's other toy count should be 1") } // Query hamsterToy := Toy{}
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Wed Jul 08 09:59:40 GMT 2020 - 4.2K bytes - Viewed (0) -
tests/joins_table_test.go
t.Fatalf("failed to delete person, got error: %v", err) } if count := DB.Unscoped().Model(&person2).Association("Addresses").Count(); count != 2 { t.Errorf("person's addresses expects 2, got %v", count) } if count := DB.Model(&person2).Association("Addresses").Count(); count != 0 { t.Errorf("person's addresses expects 2, got %v", count) }
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Thu Sep 10 13:46:18 GMT 2020 - 3.5K bytes - Viewed (0) -
tests/multi_primary_keys_test.go
if !compareTags(blog.Tags, []string{"tag1", "tag2", "tag3"}) { t.Fatalf("Blog should has three tags after Append") } if count := DB.Model(&blog).Association("Tags").Count(); count != 3 { t.Fatalf("Blog should has 3 tags after Append, got %v", count) } var tags []Tag DB.Model(&blog).Association("Tags").Find(&tags) if !compareTags(tags, []string{"tag1", "tag2", "tag3"}) {
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Thu Jan 06 07:02:53 GMT 2022 - 12.8K bytes - Viewed (0)