(stmt *gorm.Statement, s *schema.Schema, defaultUpdatingColumns []string)
| 358 | } |
| 359 | |
| 360 | func onConflictOption(stmt *gorm.Statement, s *schema.Schema, defaultUpdatingColumns []string) (onConflict clause.OnConflict) { |
| 361 | if len(defaultUpdatingColumns) > 0 || stmt.DB.FullSaveAssociations { |
| 362 | onConflict.Columns = make([]clause.Column, 0, len(s.PrimaryFieldDBNames)) |
| 363 | for _, dbName := range s.PrimaryFieldDBNames { |
| 364 | onConflict.Columns = append(onConflict.Columns, clause.Column{Name: dbName}) |
| 365 | } |
| 366 | |
| 367 | onConflict.UpdateAll = stmt.DB.FullSaveAssociations |
| 368 | if !onConflict.UpdateAll { |
| 369 | onConflict.DoUpdates = clause.AssignmentColumns(defaultUpdatingColumns) |
| 370 | } |
| 371 | } else { |
| 372 | onConflict.DoNothing = true |
| 373 | } |
| 374 | |
| 375 | return |
| 376 | } |
| 377 | |
| 378 | func saveAssociations(db *gorm.DB, rel *schema.Relationship, rValues reflect.Value, selectColumns map[string]bool, restricted bool, defaultUpdatingColumns []string) error { |
| 379 | // stop save association loop |
no test coverage detected