- Sort Score
- Result 10 results
- Languages All
Results 1 - 7 of 7 for Number (0.23 sec)
-
tests/update_has_one_test.go
} number := "number-has-one-associations" cusUser := CustomizeUser{ Name: "update-has-one-associations", Account: CustomizeAccount{ Number: number, Number2: number, }, } if err := DB.Create(&cusUser).Error; err != nil { t.Fatalf("errors happened when create: %v", err) } cusUser.Account.Number += "-update" cusUser.Account.Number2 += "-update"
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Thu Jul 14 06:55:54 GMT 2022 - 3.6K bytes - Viewed (0) -
utils/tests/models.go
Languages []Language `gorm:"many2many:UserSpeak;"` Friends []*User `gorm:"many2many:user_friends;"` Active bool } type Account struct { gorm.Model UserID sql.NullInt64 Number string } type Pet struct { gorm.Model UserID *uint Name string Toy Toy `gorm:"polymorphic:Owner;"` } type Toy struct { gorm.Model Name string OwnerID string
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Dec 15 08:36:08 GMT 2023 - 2.1K bytes - Viewed (0) -
utils/utils.go
dir = filepath.Dir(dir) s := filepath.Dir(dir) if filepath.Base(s) != "gorm.io" { s = dir } return filepath.ToSlash(s) + "/" } // FileWithLineNum return the file name and line number of the current file func FileWithLineNum() string { pcs := [13]uintptr{} // the third caller usually from gorm internal len := runtime.Callers(3, pcs[:]) frames := runtime.CallersFrames(pcs[:len])
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/associations_has_one_test.go
func TestHasOneAssociationWithSelect(t *testing.T) { user := *GetUser("hasone", Config{Account: true}) DB.Omit("Account.Number").Create(&user) AssertAssociationCount(t, user, "Account", 1, "") var account Account DB.Model(&user).Association("Account").Find(&account) if account.Number != "" { t.Errorf("account's number should not be saved") } } func TestHasOneAssociationForSlice(t *testing.T) { users := []User{
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Thu Jan 06 07:02:53 GMT 2022 - 6.8K bytes - Viewed (0) -
tests/helper_test.go
if user.Account.Number != "" { if !user.Account.UserID.Valid { t.Errorf("Account's foreign key should be saved") } else { var account Account db(unscoped).First(&account, "user_id = ?", user.ID) AssertObjEqual(t, account, user.Account, "ID", "CreatedAt", "UpdatedAt", "DeletedAt", "UserID", "Number") } } })
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Tue Mar 19 03:50:28 GMT 2024 - 8K bytes - Viewed (0) -
tests/serializer_test.go
if DB.Dialector.Name() == "postgres" { sps := SerializerPostgresStruct(*s) return &sps } return s } type Roles []string type Job struct { Title string Number int Location string IsIntern bool } type EncryptedString string func (es *EncryptedString) Scan(ctx context.Context, field *schema.Field, dst reflect.Value, dbValue interface{}) (err error) {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Apr 21 14:09:38 GMT 2023 - 7.6K bytes - Viewed (0) -
tests/tests_test.go
// CREATE DATABASE gorm; // GO // CREATE LOGIN gorm WITH PASSWORD = 'LoremIpsum86'; // CREATE USER gorm FROM LOGIN gorm; // ALTER SERVER ROLE sysadmin ADD MEMBER [gorm]; // GO log.Println("testing sqlserver...") if dbDSN == "" { dbDSN = sqlserverDSN } db, err = gorm.Open(sqlserver.Open(dbDSN), cfg) case "tidb": log.Println("testing tidb...")
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Dec 15 08:36:08 GMT 2023 - 3.3K bytes - Viewed (1)