Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for CONFLICT (0.15 sec)

  1. tests/create_test.go

    	AssertEqual(t, err, nil)
    
    	u := OnConflictUser{
    		ID:     "on-conflict-user-id",
    		Name:   "on-conflict-user-name",
    		Email:  "on-conflict-user-email",
    		Mobile: "on-conflict-user-mobile",
    	}
    	err = DB.Create(&u).Error
    	AssertEqual(t, err, nil)
    
    	u.Name = "on-conflict-user-name-2"
    	u.Email = "on-conflict-user-email-2"
    	u.Mobile = ""
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 26.4K bytes
    - Viewed (0)
  2. tests/upsert_test.go

    	} else if len(langs) != 1 {
    		t.Errorf("should only find only 1 languages, but got %+v", langs)
    	} else if langs[0].Name != "upsert-new" {
    		t.Errorf("should update name on conflict, but got name %+v", langs[0].Name)
    	}
    
    	lang = Language{Code: "upsert", Name: "Upsert-Newname"}
    	if err := DB.Clauses(clause.OnConflict{UpdateAll: true}).Create(&lang).Error; err != nil {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Sep 05 07:39:19 GMT 2022
    - 11.4K bytes
    - Viewed (0)
  3. callbacks/create.go

    		}
    
    		isDryRun := !db.DryRun && db.Error == nil
    		if !isDryRun {
    			return
    		}
    
    		ok, mode := hasReturning(db, supportReturning)
    		if ok {
    			if c, ok := db.Statement.Clauses["ON CONFLICT"]; ok {
    				if onConflict, _ := c.Expression.(clause.OnConflict); onConflict.DoNothing {
    					mode |= gorm.ScanOnConflictDoNothing
    				}
    			}
    
    			rows, err := db.Statement.ConnPool.QueryContext(
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 08 03:29:55 GMT 2024
    - 12.5K bytes
    - Viewed (0)
  4. finisher_api.go

    		reflectValue = reflect.Indirect(reflectValue)
    	}
    
    	switch reflectValue.Kind() {
    	case reflect.Slice, reflect.Array:
    		if _, ok := tx.Statement.Clauses["ON CONFLICT"]; !ok {
    			tx = tx.Clauses(clause.OnConflict{UpdateAll: true})
    		}
    		tx = tx.callbacks.Create().Execute(tx.Set("gorm:update_track_time", true))
    	case reflect.Struct:
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 22.7K bytes
    - Viewed (0)
Back to top