Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 90 for References (0.2 sec)

  1. schema/relationship.go

    	}
    
    	references := make([]interface{}, 0, len(constraint.References))
    	for _, field := range constraint.References {
    		references = append(references, clause.Column{Name: field.DBName})
    	}
    	vars = append(vars, clause.Table{Name: constraint.Name}, foreignKeys, clause.Table{Name: constraint.ReferenceSchema.Table}, references)
    	return
    }
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 22.4K bytes
    - Viewed (0)
  2. schema/schema_test.go

    	// check relations
    	relations := []Relation{
    		{
    			Name: "Account", Type: schema.HasOne, Schema: "User", FieldSchema: "Account",
    			References: []Reference{{"ID", "User", "UserID", "Account", "", true}},
    		},
    		{
    			Name: "Pets", Type: schema.HasMany, Schema: "User", FieldSchema: "Pet",
    			References: []Reference{{"ID", "User", "UserID", "Pet", "", true}},
    		},
    		{
    			Name: "Toys", Type: schema.HasMany, Schema: "User", FieldSchema: "Toy",
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 12.9K bytes
    - Viewed (0)
  3. association.go

    		var oldBelongsToExpr clause.Expression
    		// we have to record the old BelongsTo value
    		if association.Unscope && rel.Type == schema.BelongsTo {
    			var foreignFields []*schema.Field
    			for _, ref := range rel.References {
    				if !ref.OwnPrimaryKey {
    					foreignFields = append(foreignFields, ref.ForeignKey)
    				}
    			}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu May 04 11:30:45 GMT 2023
    - 21.2K bytes
    - Viewed (0)
  4. callbacks/preload.go

    	)
    
    	if rel.JoinTable != nil {
    		var (
    			joinForeignFields    = make([]*schema.Field, 0, len(rel.References))
    			joinRelForeignFields = make([]*schema.Field, 0, len(rel.References))
    			joinForeignKeys      = make([]string, 0, len(rel.References))
    		)
    
    		for _, ref := range rel.References {
    			if ref.OwnPrimaryKey {
    				joinForeignKeys = append(joinForeignKeys, ref.ForeignKey.DBName)
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  5. schema/schema_helper_test.go

    				}
    			}
    
    			if len(relation.References) != len(r.References) {
    				t.Errorf("schema %v relation's reference's count doesn't match, expects %v, but got %v", s, len(relation.References), len(r.References))
    			}
    
    			for _, ref := range relation.References {
    				var found bool
    				for _, rf := range r.References {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 7.5K bytes
    - Viewed (0)
  6. src/cmd/asm/doc.go

    		after consulting $GOROOT/pkg/$GOOS_$GOARCH.
    	-S
    		Print assembly and machine code.
    	-V
    		Print assembler version and exit.
    	-debug
    		Dump instructions as they are parsed.
    	-dynlink
    		Support references to Go symbols defined in other shared libraries.
    	-e
    		No limit on number of errors reported.
    	-gensymabis
    		Write symbol ABI information to output file. Don't assemble.
    	-o file
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Tue Aug 22 20:46:45 GMT 2023
    - 1.8K bytes
    - Viewed (0)
  7. src/cmd/cgo/doc.go

    	void _cgo_reginit(void) { }
    
    The extra functions here are stubs to satisfy the references in the C
    code generated for gcc. The build process links this stub, along with
    _cgo_export.c and *.cgo2.c, into a dynamic executable and then lets
    cgo examine the executable. Cgo records the list of shared library
    references and resolved names and writes them into a new file
    _cgo_import.go, which looks like:
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Sun Mar 31 09:02:45 GMT 2024
    - 42.1K bytes
    - Viewed (0)
  8. tests/associations_test.go

    		MemberID uint
    	}
    
    	type Member struct {
    		ID      uint
    		Refer   uint `gorm:"uniqueIndex"`
    		Name    string
    		Profile Profile `gorm:"Constraint:OnUpdate:CASCADE,OnDelete:CASCADE;FOREIGNKEY:MemberID;References:Refer"`
    	}
    
    	DB.Migrator().DropTable(&Profile{}, &Member{})
    
    	if err := DB.AutoMigrate(&Profile{}, &Member{}); err != nil {
    		t.Fatalf("Failed to migrate, got error: %v", err)
    	}
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Feb 08 08:29:09 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  9. tests/error_translator_test.go

    		gorm.Model
    		Name string `gorm:"unique"`
    	}
    
    	type Museum struct {
    		gorm.Model
    		Name   string `gorm:"unique"`
    		CityID uint
    		City   City `gorm:"Constraint:OnUpdate:CASCADE,OnDelete:CASCADE;FOREIGNKEY:CityID;References:ID"`
    	}
    
    	db, err := OpenTestConnection(&gorm.Config{TranslateError: true})
    	if err != nil {
    		t.Fatalf("failed to connect database, got error %v", err)
    	}
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Jul 12 13:21:22 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  10. callbacks/associations.go

    									}
    								}
    
    								elems = reflect.Append(elems, rv)
    							}
    						}
    					}
    
    					if elems.Len() > 0 {
    						assignmentColumns := make([]string, 0, len(rel.References))
    						for _, ref := range rel.References {
    							assignmentColumns = append(assignmentColumns, ref.ForeignKey.DBName)
    						}
    
    						saveAssociations(db, rel, elems, selectColumns, restricted, assignmentColumns)
    					}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Apr 11 03:06:13 GMT 2023
    - 14.3K bytes
    - Viewed (0)
Back to top