Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for testOrder0 (0.25 sec)

  1. tests/query_test.go

    	}
    
    	result = User{}
    	if DB.Where(map[string]interface{}{}).Where("name = ?", user.Name).First(&result).Error != nil {
    		t.Errorf("Should not raise any error if searching with empty map")
    	}
    }
    
    func TestOrder(t *testing.T) {
    	dryDB := DB.Session(&gorm.Session{DryRun: true})
    
    	result := dryDB.Order("").Find(&User{})
    	if !regexp.MustCompile("SELECT \\* FROM .*users.* IS NULL$").MatchString(result.Statement.SQL.String()) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 49.8K bytes
    - Viewed (0)
Back to top