Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for AssignmentColumns (0.13 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. 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)
  3. 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