Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for detected (0.15 sec)

  1. tests/soft_delete_test.go

    	}
    
    	if sql.NullTime(user.DeletedAt).Time.IsZero() {
    		t.Fatalf("user's deleted at is zero")
    	}
    
    	sql := DB.Session(&gorm.Session{DryRun: true}).Delete(&user).Statement.SQL.String()
    	if !regexp.MustCompile(`UPDATE .users. SET .deleted_at.=.* WHERE .users.\..id. = .* AND .users.\..deleted_at. IS NULL`).MatchString(sql) {
    		t.Fatalf("invalid sql generated, got %v", sql)
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Feb 01 06:40:55 GMT 2023
    - 5.7K bytes
    - Viewed (0)
  2. tests/connpool_test.go

    			"SELECT * FROM `users` WHERE name = ? AND `users`.`deleted_at` IS NULL ORDER BY `users`.`id` LIMIT ?",
    			"INSERT INTO `users` (`created_at`,`updated_at`,`deleted_at`,`name`,`age`,`birthday`,`company_id`,`manager_id`,`active`) VALUES (?,?,?,?,?,?,?,?,?)",
    			"SELECT * FROM `users` WHERE name = ? AND `users`.`deleted_at` IS NULL ORDER BY `users`.`id` LIMIT ?",
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Feb 06 02:54:40 GMT 2024
    - 5.5K bytes
    - Viewed (0)
  3. logger/sql_test.go

    			NumericRegexp: nil,
    			Vars:          []interface{}{"jinzhu", 1, 999.99, true, []byte("12345"), tt, &tt, nil, "w@g.\"com", myrole, pwd},
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 21 08:00:02 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  4. tests/main_test.go

    		t.Errorf("Should got error with invalid SQL")
    	}
    
    	DB.Model(&User{}).Count(&count2)
    	if count1 != count2 {
    		t.Errorf("No user should not be deleted by invalid SQL")
    	}
    }
    
    func TestSetAndGet(t *testing.T) {
    	if value, ok := DB.Set("hello", "world").Get("hello"); !ok {
    		t.Errorf("Should be able to get setting after set")
    	} else if value.(string) != "world" {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 24 01:31:58 GMT 2022
    - 1.4K bytes
    - Viewed (0)
  5. tests/joins_table_test.go

    		t.Fatalf("Should found soft deleted addresses with unscoped")
    	}
    
    	if DB.Unscoped().Model(&person).Association("Addresses").Count() != 2 {
    		t.Fatalf("Should found soft deleted addresses with unscoped")
    	}
    
    	DB.Model(&person).Association("Addresses").Clear()
    
    	if DB.Model(&person).Association("Addresses").Count() != 0 {
    		t.Fatalf("Should deleted all addresses")
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Sep 10 13:46:18 GMT 2020
    - 3.5K bytes
    - Viewed (0)
  6. tests/delete_test.go

    		gorm.Model
    		Name string
    	}
    
    	DB.Table("deleted_users").Migrator().DropTable(UserWithDelete{})
    	DB.Table("deleted_users").AutoMigrate(UserWithDelete{})
    
    	user := UserWithDelete{Name: "delete1"}
    	DB.Table("deleted_users").Create(&user)
    
    	var result UserWithDelete
    	if err := DB.Table("deleted_users").First(&result).Error; err != nil {
    		t.Errorf("failed to find deleted user, got error %v", err)
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Oct 10 07:03:34 GMT 2023
    - 9.4K bytes
    - Viewed (0)
  7. tests/associations_belongs_to_test.go

    		t.Errorf("no error should happened when deleting company, but got %v", err)
    	}
    
    	if users[0].CompanyID != nil || users[0].Company.ID != 0 {
    		t.Errorf("users[0]'s company should be deleted'")
    	}
    
    	AssertAssociationCount(t, users, "Company", 2, "After Delete")
    
    	// Clear
    	DB.Model(&users).Association("Company").Clear()
    	AssertAssociationCount(t, users, "Company", 0, "After Clear")
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 9.3K bytes
    - Viewed (0)
Back to top