- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for design (0.18 sec)
-
chainable_api.go
tx.Statement.attrs = attrs return } // Assign provide attributes used in [FirstOrCreate] or [FirstOrInit] // // Assign adds attributes even if the record is found. If using FirstOrCreate, this means that // records will be updated even if they are found. // // // assign an email regardless of if the record is not found // db.Where(User{Name: "non_existing"}).Assign(User{Email: "******@****.***"}).FirstOrInit(&user)
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
// FirstOrInit never modifies the database. It is often used with Assign and Attrs. // // // assign an email if the record is not found // db.Where(User{Name: "non_existing"}).Attrs(User{Email: "******@****.***"}).FirstOrInit(&user) // // user -> User{Name: "non_existing", Email: "******@****.***"} // // // assign email regardless of if record is found // db.Where(User{Name: "jinzhu"}).Assign(User{Email: "******@****.***"}).FirstOrInit(&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
fieldValues[idx], _ = field.ValueOf(tx.Statement.Context, elem) } datas, ok := identityMap[utils.ToStringKey(fieldValues...)] if !ok { return fmt.Errorf("failed to assign association %#v, make sure foreign fields exists", elem.Interface()) } for _, data := range datas { reflectFieldValue := rel.Field.ReflectValueOf(tx.Statement.Context, data)
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)