Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for AllowGlobalUpdate (0.36 sec)

  1. gorm.go

    	// IgnoreRelationshipsWhenMigrating
    	IgnoreRelationshipsWhenMigrating bool
    	// DisableNestedTransaction disable nested transaction
    	DisableNestedTransaction bool
    	// AllowGlobalUpdate allow global update
    	AllowGlobalUpdate bool
    	// QueryFields executes the SQL query with all fields of the table
    	QueryFields bool
    	// CreateBatchSize default create batch size
    	CreateBatchSize int
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sun Aug 20 11:46:56 GMT 2023
    - 11.6K bytes
    - Viewed (0)
  2. callbacks/helper.go

    				return true, 0
    			}
    			return true, gorm.ScanUpdate
    		}
    	}
    	return false, 0
    }
    
    func checkMissingWhereConditions(db *gorm.DB) {
    	if !db.AllowGlobalUpdate && db.Error == nil {
    		where, withCondition := db.Statement.Clauses["WHERE"]
    		if withCondition {
    			if _, withSoftDelete := db.Statement.Clauses["soft_delete_enabled"]; withSoftDelete {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 14 12:32:57 GMT 2022
    - 3.7K bytes
    - Viewed (0)
  3. tests/scanner_valuer_test.go

    	}
    
    	if !reflect.DeepEqual([]interface{}{"jinzhu", "POINT(100 100)"}, stmt.Vars) {
    		t.Errorf("generated vars is not equal, got %v", stmt.Vars)
    	}
    
    	stmt = dryRunDB.Session(&gorm.Session{
    		AllowGlobalUpdate: true,
    	}).Model(&UserWithPoint{}).Updates(UserWithPoint{
    		Name:  "jinzhu",
    		Point: Point{X: 100, Y: 100},
    	}).Statement
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Jun 07 07:02:07 GMT 2023
    - 10.6K bytes
    - Viewed (0)
  4. tests/delete_test.go

    	if err := DB.Delete(&User{}).Error; err == nil || !errors.Is(err, gorm.ErrMissingWhereClause) {
    		t.Errorf("should returns missing WHERE clause while deleting error")
    	}
    
    	if err := DB.Session(&gorm.Session{AllowGlobalUpdate: true}).Delete(&User{}).Error; err != nil {
    		t.Errorf("should returns no error while enable global update, but got err %v", err)
    	}
    }
    
    func TestDeleteWithAssociations(t *testing.T) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Oct 10 07:03:34 GMT 2023
    - 9.4K bytes
    - Viewed (0)
  5. tests/update_test.go

    		t.Errorf("should returns missing WHERE clause while updating error, got err %v", err)
    	}
    
    	if err := DB.Session(&gorm.Session{AllowGlobalUpdate: true}).Model(&User{}).Update("name", "jinzhu").Error; err != nil {
    		t.Errorf("should returns no error while enable global update, but got err %v", err)
    	}
    }
    
    func TestSelectWithUpdate(t *testing.T) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Dec 04 03:50:58 GMT 2023
    - 30.3K bytes
    - Viewed (0)
Back to top