Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for Ball (0.13 sec)

  1. tests/joins_test.go

    	sort.Slice(results, func(i, j int) bool {
    		return user.Pets[i].ID > user.Pets[j].ID
    	})
    
    	if len(results) != 2 || results[0].Name != user.Pets[0].Name || results[1].Name != user.Pets[1].Name {
    		t.Errorf("Should find all two pets with Join select, got %+v", results)
    	}
    }
    
    func TestJoinWithOmit(t *testing.T) {
    	user := *GetUser("joins_with_omit", Config{Pets: 2})
    	DB.Save(&user)
    
    	results := make([]*User, 0)
    
    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)
  2. chainable_api.go

    	db.Statement.scopes = nil
    	for _, scope := range scopes {
    		db = scope(db)
    	}
    	return db
    }
    
    // Preload preload associations with given conditions
    //
    //	// get all users, and preload all non-cancelled orders
    //	db.Preload("Orders", "state NOT IN (?)", "cancelled").Find(&users)
    func (db *DB) Preload(query string, args ...interface{}) (tx *DB) {
    	tx = db.getInstance()
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Apr 17 03:38:55 GMT 2024
    - 14.3K bytes
    - Viewed (1)
  3. tests/hooks_test.go

    		if products[idx].Price != value {
    			t.Errorf("invalid price for product #%v, expects: %v, got %v", idx, value, products[idx].Price)
    		}
    	}
    
    	DB.Model(&products).Update("Name", "product-name")
    
    	// will set all product's price to last product's price + 10
    	for idx, value := range []int64{410, 410, 410} {
    		if products[idx].Price != value {
    			t.Errorf("invalid price for product #%v, expects: %v, got %v", idx, value, products[idx].Price)
    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)
  4. callbacks/associations.go

    	}
    
    	return db.AddError(tx.Create(values).Error)
    }
    
    // check association values has been saved
    // if values kind is Struct, check it has been saved
    // if values kind is Slice/Array, check all items have been saved
    var visitMapStoreKey = "gorm:saved_association_map"
    
    func checkAssociationsSaved(db *gorm.DB, values reflect.Value) bool {
    	if visit, ok := db.Get(visitMapStoreKey); ok {
    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)
  5. finisher_api.go

    					return tx.callbacks.Create().Execute(tx)
    				}
    			}
    		}
    
    		fallthrough
    	default:
    		selectedUpdate := len(tx.Statement.Selects) != 0
    		// when updating, use all fields including those zero-value fields
    		if !selectedUpdate {
    			tx.Statement.Selects = append(tx.Statement.Selects, "*")
    		}
    
    		updateTx := tx.callbacks.Update().Execute(tx.Session(&Session{Initialized: true}))
    
    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)
  6. tests/multi_primary_keys_test.go

    		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")
    	}
    }
    
    func TestManyToManyWithCustomizedForeignKeys(t *testing.T) {
    	if name := DB.Dialector.Name(); name == "sqlite" || name == "sqlserver" {
    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)
  7. callbacks/preload.go

    	}
    	for _, relations := range embeddedRelations.EmbeddedRelations {
    		names = append(names, embeddedValues(relations)...)
    	}
    	return names
    }
    
    // preloadEntryPoint enters layer by layer. It will call real preload if it finds the right entry point.
    // If the current relationship is embedded or joined, current query will be ignored.
    //
    //nolint:cyclop
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  8. gorm.go

    	// DisableNestedTransaction disable nested transaction
    	DisableNestedTransaction bool
    	// AllowGlobalUpdate allow global update
    	AllowGlobalUpdate bool
    	// QueryFields executes the SQL query with all fields of the table
    	QueryFields bool
    	// CreateBatchSize default create batch size
    	CreateBatchSize int
    	// TranslateError enabling error translation
    	TranslateError bool
    
    	// ClauseBuilders clause builder
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sun Aug 20 11:46:56 GMT 2023
    - 11.6K bytes
    - Viewed (0)
  9. schema/field.go

    		val = strings.ToLower(strings.TrimSpace(val))
    		switch val {
    		case "-":
    			field.Creatable = false
    			field.Updatable = false
    			field.Readable = false
    			field.DataType = ""
    		case "all":
    			field.Creatable = false
    			field.Updatable = false
    			field.Readable = false
    			field.DataType = ""
    			field.IgnoreMigration = true
    		case "migration":
    			field.IgnoreMigration = true
    		}
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
Back to top