Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for primaryFields (0.14 sec)

  1. schema/schema.go

    					// remove the existing primary key field
    					for idx, f := range schema.PrimaryFields {
    						if f.DBName == v.DBName {
    							schema.PrimaryFields = append(schema.PrimaryFields[0:idx], schema.PrimaryFields[idx+1:]...)
    						}
    					}
    				}
    
    				if field.PrimaryKey {
    					schema.PrimaryFields = append(schema.PrimaryFields, field)
    				}
    			}
    		}
    
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Tue Aug 19 06:35:49 UTC 2025
    - 12.9K bytes
    - Viewed (0)
  2. schema/relationship.go

    					primaryFields = append(primaryFields, f)
    				}
    			}
    		} else {
    			primaryFields = primarySchema.PrimaryFields
    		}
    
    	primaryFieldLoop:
    		for _, primaryField := range primaryFields {
    			lookUpName := primarySchemaName + primaryField.Name
    			if gl == guessBelongs {
    				lookUpName = field.Name + primaryField.Name
    			}
    
    			lookUpNames := []string{lookUpName}
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Mon Aug 18 11:44:52 UTC 2025
    - 23.1K bytes
    - Viewed (1)
  3. schema/schema_helper_test.go

    	"gorm.io/gorm/utils/tests"
    )
    
    func checkSchema(t *testing.T, s *schema.Schema, v *schema.Schema, primaryFields []string) {
    	t.Run("CheckSchema/"+s.Name, func(t *testing.T) {
    		tests.AssertObjEqual(t, s, v, "Name", "Table")
    
    		for idx, field := range primaryFields {
    			var found bool
    			for _, f := range s.PrimaryFields {
    				if f.Name == field {
    					found = true
    				}
    			}
    
    			if idx == 0 {
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Thu Aug 28 02:57:17 UTC 2025
    - 7.5K bytes
    - Viewed (0)
  4. callbacks/create.go

    				if len(onConflict.DoUpdates) == 0 {
    					onConflict.DoNothing = true
    				}
    
    				// use primary fields as default OnConflict columns
    				if len(onConflict.Columns) == 0 {
    					for _, field := range stmt.Schema.PrimaryFields {
    						onConflict.Columns = append(onConflict.Columns, clause.Column{Name: field.DBName})
    					}
    				}
    				stmt.AddClause(onConflict)
    			}
    		}
    	}
    
    	return values
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Tue Jul 29 11:06:13 UTC 2025
    - 13K bytes
    - Viewed (0)
  5. finisher_api.go

    		}
    		tx = tx.callbacks.Create().Execute(tx.Set("gorm:update_track_time", true))
    	case reflect.Struct:
    		if err := tx.Statement.Parse(value); err == nil && tx.Statement.Schema != nil {
    			for _, pf := range tx.Statement.Schema.PrimaryFields {
    				if _, isZero := pf.ValueOf(tx.Statement.Context, reflectValue); isZero {
    					return tx.callbacks.Create().Execute(tx)
    				}
    			}
    		}
    
    		fallthrough
    	default:
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Tue Aug 26 06:24:29 UTC 2025
    - 22.9K bytes
    - Viewed (0)
Back to top