Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for ForeignKeys (0.16 sec)

  1. schema/relationship.go

    		sql += " ON DELETE " + constraint.OnDelete
    	}
    
    	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))
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Wed Jun 12 03:46:59 UTC 2024
    - 22.7K bytes
    - Viewed (0)
  2. 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 Nov 03 09:35:10 UTC 2024
    - Last Modified: Sat Aug 19 13:35:14 UTC 2023
    - 5.5K bytes
    - Viewed (0)
  3. association.go

    			rel           = association.Relationship
    			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 Nov 03 09:35:10 UTC 2024
    - Last Modified: Wed Jun 12 10:49:45 UTC 2024
    - 21.5K bytes
    - Viewed (0)
Back to top