Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 100 for Errorf (0.16 sec)

  1. tests/update_test.go

    	if res := DB.Model(user).Updates(values); res.Error != nil {
    		t.Errorf("errors happened when update: %v", res.Error)
    	} else if res.RowsAffected != 1 {
    		t.Errorf("rows affected should be 1, but got : %v", res.RowsAffected)
    	} else if user.Age != 5 {
    		t.Errorf("Age should equals to 5, but got %v", user.Age)
    	} else if user.Active != true {
    		t.Errorf("Active should be true, but got %v", user.Active)
    	}
    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)
  2. 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)
  3. callbacks/interfaces.go

    type BeforeCreateInterface interface {
    	BeforeCreate(*gorm.DB) error
    }
    
    type AfterCreateInterface interface {
    	AfterCreate(*gorm.DB) error
    }
    
    type BeforeUpdateInterface interface {
    	BeforeUpdate(*gorm.DB) error
    }
    
    type AfterUpdateInterface interface {
    	AfterUpdate(*gorm.DB) error
    }
    
    type BeforeSaveInterface interface {
    	BeforeSave(*gorm.DB) error
    }
    
    type AfterSaveInterface interface {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Aug 27 07:03:57 GMT 2020
    - 667 bytes
    - Viewed (0)
  4. tests/tracer_test.go

    }
    
    func (S Tracer) LogMode(level logger.LogLevel) logger.Interface {
    	return S.Logger.LogMode(level)
    }
    
    func (S Tracer) Info(ctx context.Context, s string, i ...interface{}) {
    	S.Logger.Info(ctx, s, i...)
    }
    
    func (S Tracer) Warn(ctx context.Context, s string, i ...interface{}) {
    	S.Logger.Warn(ctx, s, i...)
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Oct 18 09:28:06 GMT 2022
    - 830 bytes
    - Viewed (0)
  5. soft_delete.go

    // Scan implements the Scanner interface.
    func (n *DeletedAt) Scan(value interface{}) error {
    	return (*sql.NullTime)(n).Scan(value)
    }
    
    // Value implements the driver Valuer interface.
    func (n DeletedAt) Value() (driver.Value, error) {
    	if !n.Valid {
    		return nil, nil
    	}
    	return n.Time, nil
    }
    
    func (n DeletedAt) MarshalJSON() ([]byte, error) {
    	if n.Valid {
    		return json.Marshal(n.Time)
    	}
    	return json.Marshal(nil)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Feb 01 06:40:55 GMT 2023
    - 4.5K bytes
    - Viewed (0)
  6. callbacks/associations.go

    	"reflect"
    	"strings"
    
    	"gorm.io/gorm"
    	"gorm.io/gorm/clause"
    	"gorm.io/gorm/schema"
    	"gorm.io/gorm/utils"
    )
    
    func SaveBeforeAssociations(create bool) func(db *gorm.DB) {
    	return func(db *gorm.DB) {
    		if db.Error == nil && db.Statement.Schema != nil {
    			selectColumns, restricted := db.Statement.SelectAndOmitColumns(create, !create)
    
    			// Save Belongs To associations
    			for _, rel := range db.Statement.Schema.Relationships.BelongsTo {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Apr 11 03:06:13 GMT 2023
    - 14.3K bytes
    - Viewed (0)
  7. tests/scan_test.go

    	if err != nil {
    		t.Errorf("Not error should happen, got %v", err)
    	}
    
    	type Result struct {
    		Name string
    		Age  int
    	}
    
    	var results []Result
    	for rows.Next() {
    		var result Result
    		if err := DB.ScanRows(rows, &result); err != nil {
    			t.Errorf("should get no error, but got %v", err)
    		}
    		results = append(results, result)
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat May 28 14:18:07 GMT 2022
    - 8.2K bytes
    - Viewed (0)
  8. tests/associations_has_one_test.go

    	if err := DB.Model(&user2).Association("Account").Append(&account); err != nil {
    		t.Fatalf("Error happened when append Account, got %v", err)
    	}
    
    	AssertAssociationCount(t, user2, "Account", 1, "after prepare data")
    
    	// Clear
    	if err := DB.Model(&user2).Association("Account").Clear(); err != nil {
    		t.Errorf("Error happened when clear Account, got %v", err)
    	}
    
    	AssertAssociationCount(t, user2, "Account", 0, "after clear")
    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)
  9. errors.go

    	// ErrSubQueryRequired sub query required
    	ErrSubQueryRequired = errors.New("sub query required")
    	// ErrInvalidData unsupported data
    	ErrInvalidData = errors.New("unsupported data")
    	// ErrUnsupportedDriver unsupported driver
    	ErrUnsupportedDriver = errors.New("unsupported driver")
    	// ErrRegistered registered
    	ErrRegistered = errors.New("registered")
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 02:53:17 GMT 2024
    - 2.5K bytes
    - Viewed (0)
  10. tests/helper_test.go

    }
    
    func doCheckPet(t *testing.T, pet Pet, expect Pet, unscoped bool) {
    	if pet.ID != 0 {
    		var newPet Pet
    		if err := db(unscoped).Where("id = ?", pet.ID).First(&newPet).Error; err != nil {
    			t.Fatalf("errors happened when query: %v", err)
    		} else {
    			AssertObjEqual(t, newPet, pet, "ID", "CreatedAt", "UpdatedAt", "DeletedAt", "UserID", "Name")
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 8K bytes
    - Viewed (0)
Back to top