Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for detected (0.16 sec)

  1. tests/hooks_test.go

    	if product.Name != "Product New" || product.Price != 160 || product.Code != "L1212" {
    		t.Errorf("invalid data after update, got %+v", product)
    	}
    
    	// Code changed, but not selected, price should not change
    	DB.Model(&product).Select("Name", "Price").Updates(map[string]interface{}{"Name": "Product New2", "code": "L1213"})
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Feb 18 01:20:29 GMT 2023
    - 15.9K bytes
    - Viewed (0)
  2. tests/table_test.go

    	if !regexp.MustCompile("SELECT \\* FROM \\(SELECT .name. FROM .users. WHERE .users.\\..deleted_at. IS NULL\\) as u, \\(SELECT .name. FROM .pets. WHERE .pets.\\..deleted_at. IS NULL\\) as p WHERE .u.\\..deleted_at. IS NULL").MatchString(r.Statement.SQL.String()) {
    		t.Errorf("Table with escape character, got %v", r.Statement.SQL.String())
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Mar 09 09:31:28 GMT 2024
    - 10.6K bytes
    - Viewed (0)
  3. finisher_api.go

    	return tx.callbacks.Update().Execute(tx)
    }
    
    // Delete deletes value matching given conditions. If value contains primary key it is included in the conditions. If
    // value includes a deleted_at field, then Delete performs a soft delete instead by setting deleted_at with the current
    // time if null.
    func (db *DB) Delete(value interface{}, conds ...interface{}) (tx *DB) {
    	tx = db.getInstance()
    	if len(conds) > 0 {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 22.7K bytes
    - Viewed (0)
  4. tests/update_test.go

    	}
    
    	dryDB := DB.Session(&gorm.Session{DryRun: true})
    	stmt := dryDB.Save(&user).Statement
    	if !regexp.MustCompile(`.users.\..deleted_at. IS NULL`).MatchString(stmt.SQL.String()) {
    		t.Fatalf("invalid updating SQL, got %v", stmt.SQL.String())
    	}
    
    	dryDB = DB.Session(&gorm.Session{DryRun: true})
    	stmt = dryDB.Unscoped().Save(&user).Statement
    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)
  5. schema/field_test.go

    		"created_at": user.CreatedAt,
    		"deleted_at": user.DeletedAt,
    		"age":        user.Age,
    		"birthday":   user.Birthday,
    		"active":     true,
    	}
    	checkField(t, userSchema, reflectValue, values)
    
    	// test setter
    	newValues := map[string]interface{}{
    		"name":       "valuer_and_setter_2",
    		"id":         2,
    		"created_at": time.Now(),
    		"deleted_at": time.Now(),
    		"age":        20,
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Feb 19 09:02:53 GMT 2022
    - 12.7K bytes
    - Viewed (0)
  6. statement.go

    				switch reflectValue.Kind() {
    				case reflect.Struct:
    					for _, field := range s.Fields {
    						selected := selectedColumns[field.DBName] || selectedColumns[field.Name]
    						if selected || (!restricted && field.Readable) {
    							if v, isZero := field.ValueOf(stmt.Context, reflectValue); !isZero || selected {
    								if field.DBName != "" {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 19.8K bytes
    - Viewed (0)
  7. schema/schema_test.go

    		{Name: "UpdatedAt", DBName: "updated_at", BindNames: []string{"Model", "UpdatedAt"}, DataType: schema.Time},
    		{Name: "DeletedAt", DBName: "deleted_at", BindNames: []string{"Model", "DeletedAt"}, Tag: `gorm:"index"`, DataType: schema.Time},
    		{Name: "Name", DBName: "name", BindNames: []string{"Name"}, DataType: schema.String},
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 12.9K bytes
    - Viewed (0)
  8. tests/multi_primary_keys_test.go

    	}
    
    	DB.Model(&blog).Association("Tags").Delete(tag3)
    	var tags4 []Tag
    	DB.Model(&blog).Association("Tags").Find(&tags4)
    	if !compareTags(tags4, []string{"tag6"}) {
    		t.Fatalf("Tag should not be deleted when Delete with a unrelated tag")
    	}
    
    	// Clear
    	DB.Model(&blog).Association("Tags").Clear()
    	if DB.Model(&blog).Association("Tags").Count() != 0 {
    		t.Fatalf("All tags should be cleared")
    	}
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 12.8K bytes
    - Viewed (0)
  9. tests/preload_test.go

    	if len(user3.Pets) != 0 {
    		t.Fatalf("User.Pet[0] was deleted and should not exist.")
    	}
    
    	var user4 *User
    	DB.Preload("Pets.Toy").Find(&user4, "id = ?", user.ID)
    	if len(user4.Pets) != 0 {
    		t.Fatalf("User.Pet[0] was deleted and should not exist.")
    	}
    
    	var user5 User
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 14.9K bytes
    - Viewed (0)
  10. tests/sql_builder_test.go

    	if !regexp.MustCompile(`WHERE \(a = .+ or b = .+\) AND .users.\..deleted_at. IS NULL`).MatchString(sql) {
    		t.Fatalf("invalid sql generated, got %v", sql)
    	}
    
    	sql = dryRunDB.Where("a = ? or b = ?", "a", "b").Or("c = ? and d = ?", "c", "d").Find(&User{}).Statement.SQL.String()
    	if !regexp.MustCompile(`WHERE \(\(a = .+ or b = .+\) OR \(c = .+ and d = .+\)\) AND .users.\..deleted_at. IS NULL`).MatchString(sql) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 16.7K bytes
    - Viewed (0)
Back to top