- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 12 for foreignKeys (0.06 sec)
-
schema/relationship.go
} if constraint.OnUpdate != "" { sql += " ON UPDATE " + constraint.OnUpdate } foreignKeys := make([]interface{}, 0, len(constraint.ForeignKeys)) for _, field := range constraint.ForeignKeys { foreignKeys = append(foreignKeys, clause.Column{Name: field.DBName}) } references := make([]interface{}, 0, len(constraint.References)) for _, field := range constraint.References {Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Sun Nov 16 04:11:05 UTC 2025 - 23.1K bytes - Viewed (1) -
association.go
primaryFields []*schema.Field foreignKeys []string updateAttrs = map[string]interface{}{} conds []clause.Expression ) for _, ref := range rel.References { if ref.PrimaryValue == "" { primaryFields = append(primaryFields, ref.PrimaryKey) foreignKeys = append(foreignKeys, ref.ForeignKey.DBName) updateAttrs[ref.ForeignKey.DBName] = nil } else {
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Sun Oct 26 12:09:12 UTC 2025 - 23.6K bytes - Viewed (0) -
schema/utils.go
} // ToQueryValues to query values func ToQueryValues(table string, foreignKeys []string, foreignValues [][]interface{}) (interface{}, []interface{}) { queryValues := make([]interface{}, len(foreignValues)) if len(foreignKeys) == 1 { for idx, r := range foreignValues { queryValues[idx] = r[0] } return clause.Column{Table: table, Name: foreignKeys[0]}, queryValues }
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Thu Oct 30 11:15:36 UTC 2025 - 5.9K bytes - Viewed (0) -
callbacks/associations.go
db.AddError(ref.ForeignKey.Set(db.Statement.Context, f, fv)) } else if ref.PrimaryValue != "" { db.AddError(ref.ForeignKey.Set(db.Statement.Context, f, ref.PrimaryValue)) } assignmentColumns = append(assignmentColumns, ref.ForeignKey.DBName) } saveAssociations(db, rel, f, selectColumns, restricted, assignmentColumns)
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Thu Feb 13 06:16:26 UTC 2025 - 14.4K bytes - Viewed (0) -
callbacks/preload.go
joinForeignKeys = append(joinForeignKeys, ref.ForeignKey.DBName) joinForeignFields = append(joinForeignFields, ref.ForeignKey) foreignFields = append(foreignFields, ref.PrimaryKey) } else if ref.PrimaryValue != "" { tx = tx.Where(clause.Eq{Column: ref.ForeignKey.DBName, Value: ref.PrimaryValue}) } else { joinRelForeignFields = append(joinRelForeignFields, ref.ForeignKey)
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Sun May 25 07:40:40 UTC 2025 - 11.7K bytes - Viewed (0) -
schema/schema_helper_test.go
for _, rf := range r.References { if (rf.PrimaryKey == nil || (rf.PrimaryKey.Name == ref.PrimaryKey && rf.PrimaryKey.Schema.Name == ref.PrimarySchema)) && (rf.PrimaryValue == ref.PrimaryValue) && (rf.ForeignKey.Name == ref.ForeignKey && rf.ForeignKey.Schema.Name == ref.ForeignSchema) && (rf.OwnPrimaryKey == ref.OwnPrimaryKey) { found = true } } if !found { var refs []stringRegistered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Thu Aug 28 02:57:17 UTC 2025 - 7.5K bytes - Viewed (0) -
schema/relationship_test.go
Schema: "User", FieldSchema: "Toy", Polymorphic: Polymorphic{ID: "OwnerID", Type: "OwnerType", Value: "users"}, References: []Reference{ {ForeignKey: "OwnerType", ForeignSchema: "Toy", PrimaryValue: "users"}, {ForeignKey: "OwnerType", ForeignSchema: "Toy", PrimaryValue: "users"}, }, }, "Toys": { Name: "Toys", Type: schema.HasMany,
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Mon Aug 18 11:44:52 UTC 2025 - 26.5K bytes - Viewed (0) -
generics.go
} for _, ref := range rel.References { fkNil[ref.ForeignKey.DBName] = nil if ref.OwnPrimaryKey && ref.PrimaryKey != nil { ownerPKNames = append(ownerPKNames, ref.PrimaryKey.DBName) primaryColumns = append(primaryColumns, clause.Column{Name: ref.PrimaryKey.DBName}) foreignColumns = append(foreignColumns, clause.Column{Name: ref.ForeignKey.DBName}) } else if !ref.OwnPrimaryKey && ref.PrimaryKey != nil {Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Sun Nov 02 14:09:18 UTC 2025 - 25.9K bytes - Viewed (0) -
gorm.go
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 f.GORMDataType = ref.ForeignKey.GORMDataType if f.Size == 0 { f.Size = ref.ForeignKey.Size } ref.ForeignKey = f }Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Tue Aug 26 06:24:29 UTC 2025 - 12.8K bytes - Viewed (0) -
callbacks/query.go
Value: clause.Column{Table: tableAliasName, Name: ref.ForeignKey.DBName}, } } else { if ref.PrimaryValue == "" { exprs[idx] = clause.Eq{ Column: clause.Column{Table: parentTableName, Name: ref.ForeignKey.DBName}, Value: clause.Column{Table: tableAliasName, Name: ref.PrimaryKey.DBName}, }Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Sun May 25 07:40:40 UTC 2025 - 10.4K bytes - Viewed (3)