Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for Reference (0.16 sec)

  1. schema/relationship_test.go

    			References: []Reference{
    				{"ID", "Blog", "BlogID", "shared_blog_tags", "", true},
    				{"ID", "Tag", "TagID", "shared_blog_tags", "", false},
    			},
    		},
    		Relation{
    			Name: "LocaleTags", Type: schema.Many2Many, Schema: "Blog", FieldSchema: "Tag",
    			JoinTable: JoinTable{Name: "locale_blog_tags", Table: "locale_blog_tags"},
    			References: []Reference{
    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. finisher_api.go

    // Update updates column with value using callbacks. Reference: https://gorm.io/docs/update.html#Update-Changed-Fields
    func (db *DB) Update(column string, value interface{}) (tx *DB) {
    	tx = db.getInstance()
    	tx.Statement.Dest = map[string]interface{}{column: value}
    	return tx.callbacks.Update().Execute(tx)
    }
    
    // Updates updates attributes using callbacks. values must be a struct or map. Reference: https://gorm.io/docs/update.html#Update-Changed-Fields
    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)
  3. callbacks/query.go

    										Name:  s,
    										Alias: utils.NestedRelationName(tableAliasName, s),
    									})
    								}
    							}
    
    							exprs := make([]clause.Expression, len(relation.References))
    							for idx, ref := range relation.References {
    								if ref.OwnPrimaryKey {
    									exprs[idx] = clause.Eq{
    										Column: clause.Column{Table: parentTableName, Name: ref.PrimaryKey.DBName},
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Jan 29 03:34:57 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  4. 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 May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 12.9K bytes
    - Viewed (0)
  5. schema/relationship.go

    				joinRel := relation.JoinTable.Relationships.Relations[relName]
    				joinRel.Field = relation.Field
    				joinRel.References = append(joinRel.References, &Reference{
    					PrimaryKey: of,
    					ForeignKey: f,
    				})
    
    				relation.References = append(relation.References, &Reference{
    					PrimaryKey:    of,
    					ForeignKey:    f,
    					OwnPrimaryKey: true,
    				})
    			}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 22.4K bytes
    - Viewed (0)
  6. 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 May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  7. tests/associations_many2many_test.go

    	user := *GetUser("many2many_omit_associations", Config{Languages: 2})
    
    	if err := DB.Omit("Languages.*").Create(&user).Error; err == nil {
    		t.Fatalf("should raise error when create users without languages reference")
    	}
    
    	if err := DB.Create(&user.Languages).Error; err != nil {
    		t.Fatalf("no error should happen when create languages, but got %v", err)
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Jun 10 13:05:19 GMT 2023
    - 13.2K bytes
    - Viewed (0)
  8. gorm.go

    	isRelation := ok && relation.JoinTable != nil
    	if !isRelation {
    		return fmt.Errorf("failed to find relation: %s", field)
    	}
    
    	for _, ref := range relation.References {
    		f := joinSchema.LookUpField(ref.ForeignKey.DBName)
    		if f == nil {
    			return fmt.Errorf("missing field %s for join table", ref.ForeignKey.DBName)
    		}
    
    		f.DataType = ref.ForeignKey.DataType
    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)
Back to top