Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for period (0.17 sec)

  1. schema/relationship_test.go

    func TestMultipleMany2Many(t *testing.T) {
    	type Thing struct {
    		ID int
    	}
    
    	type Person struct {
    		ID       int
    		Likes    []Thing `gorm:"many2many:likes"`
    		Dislikes []Thing `gorm:"many2many:dislikes"`
    	}
    
    	checkStructRelation(t, &Person{},
    		Relation{
    			Name: "Likes", Type: schema.Many2Many, Schema: "Person", FieldSchema: "Thing",
    			JoinTable: JoinTable{Name: "likes", Table: "likes"},
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 25.5K bytes
    - Viewed (0)
  2. tests/joins_test.go

    	sort.Slice(results, func(i, j int) bool {
    		return results[i].PetID > results[j].PetID
    	})
    
    	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 {
    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)
  3. tests/create_test.go

    	}
    	if err := DB.AutoMigrate(&CompositeKeyProduct{}); err != nil {
    		t.Fatalf("failed to migrate, got error %v", err)
    	}
    
    	prod := &CompositeKeyProduct{
    		LanguageCode: 56,
    		Code:         "Code56",
    		Name:         "ProductName56",
    	}
    	if err := DB.Create(&prod).Error; err != nil {
    		t.Fatalf("failed to create, got error %v", err)
    	}
    
    	newProd := &CompositeKeyProduct{}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 26.4K bytes
    - Viewed (0)
  4. schema/schema.go

    			}
    		}
    	}
    
    	return schema, schema.err
    }
    
    // This unrolling is needed to show to the compiler the exact set of methods
    // that can be used on the modelType.
    // Prior to go1.22 any use of MethodByName would cause the linker to
    // abandon dead code elimination for the entire binary.
    // As of go1.22 the compiler supports one special case of a string constant
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Oct 10 06:50:29 GMT 2023
    - 13.7K bytes
    - Viewed (0)
Back to top