- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 70 for Errors (0.22 sec)
-
tests/update_belongs_to_test.go
user := *GetUser("update-belongs-to", Config{}) if err := DB.Create(&user).Error; err != nil { t.Fatalf("errors happened when create: %v", err) } user.Company = Company{Name: "company-belongs-to-association"} user.Manager = &User{Name: "manager-belongs-to-association"} if err := DB.Save(&user).Error; err != nil { t.Fatalf("errors happened when update: %v", err) } var user2 User
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Thu Jul 14 06:55:54 GMT 2022 - 1.6K bytes - Viewed (0) -
tests/gorm_test.go
if results := DB.Create(&u1); results.Error != nil { t.Fatalf("errors happened on create: %v", results.Error) } else if results.RowsAffected != 1 { t.Fatalf("rows affected expects: %v, got %v", 1, results.RowsAffected) } else if u1.ID == 0 { t.Fatalf("ID expects : not equal 0, got %v", u1.ID) } got := user{} results := DB.First(&got, "id = ?", u1.ID) if results.Error != nil {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Thu Jun 01 07:22:21 GMT 2023 - 3.3K bytes - Viewed (0) -
logger/logger.go
if l.LogLevel >= Warn { l.Printf(l.warnStr+msg, append([]interface{}{utils.FileWithLineNum()}, data...)...) } } // Error print error messages func (l *logger) Error(ctx context.Context, msg string, data ...interface{}) { if l.LogLevel >= Error { l.Printf(l.errStr+msg, append([]interface{}{utils.FileWithLineNum()}, data...)...) } } // Trace print sql message // //nolint:cyclop
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Tue Nov 07 02:19:41 GMT 2023 - 5.8K bytes - Viewed (0) -
tests/scanner_valuer_test.go
if err := DB.Create(&data).Error; err != nil { t.Errorf("Should got no error when creating data, but got %v", err) } if err := DB.Model(&data).Update("password", EncryptedData("xnewpass")).Error; err == nil { t.Errorf("Should failed to update data with invalid data") } if err := DB.Model(&data).Update("password", EncryptedData("newpass")).Error; err != nil {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Wed Jun 07 07:02:07 GMT 2023 - 10.6K bytes - Viewed (0) -
tests/update_test.go
if err := DB.Model(user).Update("Age", 10).Error; err != nil { t.Errorf("errors happened when update: %v", err) } else if user.Age != 10 { t.Errorf("Age should equals to 10, but got %v", user.Age) } checkUpdatedAtChanged("Update", user.UpdatedAt) checkOtherData("Update") var result User if err := DB.Where("id = ?", user.ID).First(&result).Error; err != nil { t.Errorf("errors happened when query: %v", err) } else {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Dec 04 03:50:58 GMT 2023 - 30.3K bytes - Viewed (0) -
prepare_stmt.go
} func (db *PreparedStmtDB) Ping() error { conn, err := db.GetDBConn() if err != nil { return err } return conn.Ping() } type PreparedStmtTX struct { Tx PreparedStmtDB *PreparedStmtDB } func (db *PreparedStmtTX) GetDBConn() (*sql.DB, error) { return db.PreparedStmtDB.GetDBConn() } func (tx *PreparedStmtTX) Commit() error {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Thu Mar 28 08:47:39 GMT 2024 - 6.4K bytes - Viewed (0) -
tests/count_test.go
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/joins_test.go
if db5.Error != nil { t.Errorf("Should not raise error for join where identical fields in different tables. Error: %s", db5.Error.Error()) } var users6 []User DB.Joins("inner join pets on pets.user_id = users.id AND pets.name = @Name", user.Pets[0]).Where("users.name = ?", user.Name).First(&users6) if len(users6) != 1 {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Wed Apr 26 14:19:32 GMT 2023 - 13.5K bytes - Viewed (1) -
schema/serializer.go
func (JSONSerializer) Scan(ctx context.Context, field *Field, dst reflect.Value, dbValue interface{}) (err error) { fieldValue := reflect.New(field.FieldType) if dbValue != nil { var bytes []byte switch v := dbValue.(type) { case []byte: bytes = v case string: bytes = []byte(v) default: return fmt.Errorf("failed to unmarshal JSONB value: %#v", dbValue) } if len(bytes) > 0 {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Mar 18 08:28:46 GMT 2024 - 4.6K bytes - Viewed (0) -
callbacks/helper_test.go
}, }, } for _, tc := range testCase { t.Run(tc.name, func(t *testing.T) { actual := ConvertMapToValuesForCreate(&gorm.Statement{}, tc.input) if !reflect.DeepEqual(actual, tc.expect) { t.Errorf("expect %v got %v", tc.expect, actual) } }) } } func TestConvertSliceOfMapToValuesForCreate(t *testing.T) { testCase := []struct { name string input []map[string]interface{}
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Tue Mar 05 02:22:57 GMT 2024 - 3.4K bytes - Viewed (0)