- Sort Score
- Result 10 results
- Languages All
Results 1 - 6 of 6 for Gill (0.12 sec)
-
tests/create_test.go
if result.RowsAffected != int64(len(users)) { t.Errorf("affected rows should be %v, but got %v", len(users), result.RowsAffected) } for _, user := range users { if user.ID == 0 { t.Fatalf("failed to fill user's ID, got %v", user.ID) } else { var newUser User if err := DB.Where("id = ?", user.ID).Preload(clause.Associations).First(&newUser).Error; err != nil { t.Fatalf("errors happened when query: %v", err)
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) -
chainable_api.go
) // Model specify the model you would like to run db operations // // // update all users's name to `hello` // db.Model(&User{}).Update("name", "hello") // // if user's primary key is non-blank, will use it as condition, then will only update that user's name to `hello` // db.Model(&user).Update("name", "hello") func (db *DB) Model(value interface{}) (tx *DB) { tx = db.getInstance() tx.Statement.Model = value return }
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Wed Apr 17 03:38:55 GMT 2024 - 14.3K bytes - Viewed (1) -
finisher_api.go
return } // FirstOrCreate finds the first matching record, otherwise if not found creates a new instance with given conds. // Each conds must be a struct or map. // // Using FirstOrCreate in conjunction with Assign will result in an update to the database even if the record exists. // // // assign an email if the record is not found // result := db.Where(User{Name: "non_existing"}).Attrs(User{Email: "******@****.***"}).FirstOrCreate(&user)
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Jan 12 08:42:21 GMT 2024 - 22.7K bytes - Viewed (0) -
callbacks/preload.go
names = append(names, embeddedValues(relations)...) } return names } // preloadEntryPoint enters layer by layer. It will call real preload if it finds the right entry point. // If the current relationship is embedded or joined, current query will be ignored. // //nolint:cyclop
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Thu Apr 25 12:21:03 GMT 2024 - 11.6K bytes - Viewed (0) -
tests/preload_test.go
if err != nil { t.Errorf("failed to find value, got err: %v", err) } AssertEqual(t, find1, value1) var find2 Value // Joins will automatically add Nested queries. err = DB.Joins("Nested.Join").Preload("Nested.Preloads").First(&find2, value2.ID).Error if err != nil { t.Errorf("failed to find value, got err: %v", err) }
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Thu Apr 25 12:21:03 GMT 2024 - 14.9K bytes - Viewed (0) -
tests/sql_builder_test.go
}) }) assertEqualSQL(t, `SELECT * FROM users ORDER BY id DESC`, sql) } // assertEqualSQL for assert that the sql is equal, this method will ignore quote, and dialect specials. func assertEqualSQL(t *testing.T, expected string, actually string) { t.Helper() // replace SQL quote, convert into postgresql like "" expected = replaceQuoteInSQL(expected)
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Jan 12 08:42:21 GMT 2024 - 16.7K bytes - Viewed (0)