- Sort Score
- Result 10 results
- Languages All
Results 1 - 5 of 5 for shapes (0.23 sec)
-
callbacks.go
func (cs *callbacks) Row() *processor { return cs.processors["row"] } func (cs *callbacks) Raw() *processor { return cs.processors["raw"] } func (p *processor) Execute(db *DB) *DB { // call scopes for len(db.Statement.scopes) > 0 { db = db.executeScopes() } var ( curTime = time.Now() stmt = db.Statement resetBuildClauses bool ) if len(stmt.BuildClauses) == 0 {
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/count_test.go
sort.SliceStable(users, func(i, j int) bool { return strings.Compare(users[i].Name, users[j].Name) < 0 }) AssertEqual(t, users, expects) var count9 int64 if err := DB.Scopes(func(tx *gorm.DB) *gorm.DB { return tx.Table("users") }).Where("name in ?", []string{user1.Name, user2.Name, user3.Name}).Count(&count9).Find(&users).Error; err != nil || count9 != 3 {
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) -
tests/scopes_test.go
DB.Create(&users) var users1, users2, users3 []User DB.Scopes(NameIn1And2).Find(&users1) if len(users1) != 2 { t.Errorf("Should found two users's name in 1, 2, but got %v", len(users1)) } DB.Scopes(NameIn1And2, NameIn2And3).Find(&users2) if len(users2) != 1 { t.Errorf("Should found one user's name is 2, but got %v", len(users2)) } DB.Scopes(NameIn([]string{users[0].Name, users[2].Name})).Find(&users3)
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Jan 12 08:42:21 GMT 2024 - 3.3K bytes - Viewed (0) -
tests/distinct_test.go
var names1 []string DB.Model(&User{}).Where("name like ?", "distinct%").Distinct().Order("name").Pluck("Name", &names1) AssertEqual(t, names1, []string{"distinct", "distinct-2", "distinct-3"}) var names2 []string DB.Scopes(func(db *gorm.DB) *gorm.DB { return db.Table("users") }).Where("name like ?", "distinct%").Order("name").Pluck("name", &names2) AssertEqual(t, names2, []string{"distinct", "distinct", "distinct", "distinct-2", "distinct-3"})
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) -
migrator.go
package gorm import ( "reflect" "gorm.io/gorm/clause" "gorm.io/gorm/schema" ) // Migrator returns migrator func (db *DB) Migrator() Migrator { tx := db.getInstance() // apply scopes to migrator for len(tx.Statement.scopes) > 0 { tx = tx.executeScopes() } return tx.Dialector.Migrator(tx.Session(&Session{})) } // AutoMigrate run auto migration for given models
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Oct 30 09:15:49 GMT 2023 - 3.1K bytes - Viewed (0)