Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for AssignmentColumns (0.1 sec)

  1. callbacks/associations.go

    							}
    						}
    					}
    
    					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)
    					}
    				case reflect.Struct:
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Tue Apr 11 03:06:13 UTC 2023
    - 14.3K bytes
    - Viewed (0)
  2. clause/set.go

    	assignments := make([]Assignment, len(keys))
    	for idx, key := range keys {
    		assignments[idx] = Assignment{Column: Column{Name: key}, Value: values[key]}
    	}
    	return assignments
    }
    
    func AssignmentColumns(values []string) Set {
    	assignments := make([]Assignment, len(values))
    	for idx, value := range values {
    		assignments[idx] = Assignment{Column: Column{Name: value}, Value: Column{Table: "excluded", Name: value}}
    	}
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Nov 29 03:02:44 UTC 2021
    - 1.4K bytes
    - Viewed (0)
  3. callbacks/create.go

    								} else {
    									columns = append(columns, column.Name)
    								}
    							}
    						}
    					}
    				}
    
    				onConflict.DoUpdates = append(onConflict.DoUpdates, clause.AssignmentColumns(columns)...)
    				if len(onConflict.DoUpdates) == 0 {
    					onConflict.DoNothing = true
    				}
    
    				// use primary fields as default OnConflict columns
    				if len(onConflict.Columns) == 0 {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Apr 08 03:29:55 UTC 2024
    - 12.5K bytes
    - Viewed (0)
  4. tests/upsert_test.go

    	for idx, lang := range langs {
    		lang.Name = lang.Name + "_new"
    		langs[idx] = lang
    	}
    
    	if err := DB.Clauses(clause.OnConflict{
    		Columns:   []clause.Column{{Name: "code"}},
    		DoUpdates: clause.AssignmentColumns([]string{"name"}),
    	}).Create(&langs).Error; err != nil {
    		t.Fatalf("failed to upsert, got %v", err)
    	}
    
    	for _, lang := range langs {
    		var results []Language
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Sep 05 07:39:19 UTC 2022
    - 11.4K bytes
    - Viewed (0)
Back to top