Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 45 for UPDATE (0.14 sec)

  1. clause/locking.go

    package clause
    
    const (
    	LockingStrengthUpdate    = "UPDATE"
    	LockingStrengthShare     = "SHARE"
    	LockingOptionsSkipLocked = "SKIP LOCKED"
    	LockingOptionsNoWait     = "NOWAIT"
    )
    
    type Locking struct {
    	Strength string
    	Table    Table
    	Options  string
    }
    
    // Name where clause name
    func (locking Locking) Name() string {
    	return "FOR"
    }
    
    // Build build where clause
    func (locking Locking) Build(builder Builder) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:32:56 GMT 2023
    - 773 bytes
    - Viewed (0)
  2. tests/postgres_test.go

    		t.Errorf("No error should happen, but got %v", err)
    	}
    
    	yasuo.Name = "jinzhu1"
    	if err := DB.Save(&yasuo).Error; err != nil {
    		t.Errorf("Failed to update date, got error %v", err)
    	}
    
    	if err := DB.First(&result, "id = ?", yasuo.ID).Error; err != nil || yasuo.Name != "jinzhu1" {
    		t.Errorf("No error should happen, but got %v", err)
    	}
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Oct 08 09:16:32 GMT 2022
    - 6.4K bytes
    - Viewed (3)
  3. tests/gorm_test.go

    		} else if got.ID != u1.ID {
    			t.Fatalf("select expects: %v, got %v", u1, got)
    		}
    
    		u1.Name = "jinzhu"
    		if results := DB.Save(&u1); results.Error != nil {
    			t.Fatalf("errors happened on update: %v", results.Error)
    		} else if results.RowsAffected != 1 {
    			t.Fatalf("rows affected expects: %v, got %v", 1, results.RowsAffected)
    		}
    
    		u1 = user{} // important to reinitialize this before creating it again
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jun 01 07:22:21 GMT 2023
    - 3.3K bytes
    - Viewed (0)
  4. schema/interfaces.go

    	CreateClauses(*Field) []clause.Interface
    }
    
    // QueryClausesInterface query clauses interface
    type QueryClausesInterface interface {
    	QueryClauses(*Field) []clause.Interface
    }
    
    // UpdateClausesInterface update clauses interface
    type UpdateClausesInterface interface {
    	UpdateClauses(*Field) []clause.Interface
    }
    
    // DeleteClausesInterface delete clauses interface
    type DeleteClausesInterface interface {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 980 bytes
    - Viewed (0)
  5. callbacks/create.go

    	default:
    		var (
    			selectColumns, restricted = stmt.SelectAndOmitColumns(true, false)
    			_, updateTrackTime        = stmt.Get("gorm:update_track_time")
    			isZero                    bool
    		)
    		stmt.Settings.Delete("gorm:update_track_time")
    
    		values = clause.Values{Columns: make([]clause.Column, 0, len(stmt.Schema.DBNames))}
    
    		for _, db := range stmt.Schema.DBNames {
    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)
  6. callbacks/associations.go

    	})
    
    	db.Statement.Settings.Range(func(k, v interface{}) bool {
    		tx.Statement.Settings.Store(k, v)
    		return true
    	})
    
    	if tx.Statement.FullSaveAssociations {
    		tx = tx.Set("gorm:update_track_time", true)
    	}
    
    	if len(selects) > 0 {
    		tx = tx.Select(selects)
    	} else if restricted && len(omits) == 0 {
    		tx = tx.Omit(clause.Associations)
    	}
    
    	if len(omits) > 0 {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Apr 11 03:06:13 GMT 2023
    - 14.3K bytes
    - Viewed (0)
  7. tests/scanner_valuer_test.go

    	}
    
    	if err := DB.Model(&data).Update("password", EncryptedData("xnewpass")).Error; err == nil {
    		t.Errorf("Should failed to update data with invalid data")
    	}
    
    	if err := DB.Model(&data).Update("password", EncryptedData("newpass")).Error; err != nil {
    		t.Errorf("Should got no error update data with valid data, but got %v", err)
    	}
    
    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)
  8. tests/migrate_test.go

    	if err != nil {
    		t.Errorf("AutoMigrate err:%v", err)
    	}
    
    	// delete sequence
    	err = DB.Table("events").AutoMigrate(&Event{})
    	if err != nil {
    		t.Errorf("AutoMigrate err:%v", err)
    	}
    
    	// update sequence
    	err = DB.Table("events").AutoMigrate(&Event1{})
    	if err != nil {
    		t.Errorf("AutoMigrate err:%v", err)
    	}
    	err = DB.Table("events").AutoMigrate(&Event2{})
    	if err != nil {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  9. callbacks/callbacks.go

    	updateCallback := db.Callback().Update()
    	updateCallback.Match(enableTransaction).Register("gorm:begin_transaction", BeginTransaction)
    	updateCallback.Register("gorm:setup_reflect_value", SetupUpdateReflectValue)
    	updateCallback.Register("gorm:before_update", BeforeUpdate)
    	updateCallback.Register("gorm:save_before_associations", SaveBeforeAssociations(false))
    	updateCallback.Register("gorm:update", Update(config))
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Oct 27 23:56:55 GMT 2021
    - 3.3K bytes
    - Viewed (0)
  10. tests/named_polymorphic_test.go

    	DB.Model(&hamster).Association("PreferredToy").Find(&hamsterToy)
    	if hamsterToy.Name != "bike 2" {
    		t.Errorf("Should update has one polymorphic association with Append")
    	}
    
    	hamsterToy = Toy{}
    	DB.Model(&hamster).Association("OtherToy").Find(&hamsterToy)
    	if hamsterToy.Name != "treadmill 2" {
    		t.Errorf("Should update has one polymorphic association with Append")
    	}
    
    	if DB.Model(&hamster2).Association("PreferredToy").Count() != 1 {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Jul 08 09:59:40 GMT 2020
    - 4.2K bytes
    - Viewed (0)
Back to top