Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for bear (0.12 sec)

  1. tests/sql_builder_test.go

    		return tx.Model(&User{}).Where("id = ?", 100).Update("name", "Foo bar")
    	})
    	assertEqualSQL(t, `UPDATE "users" SET "name"='Foo bar',"updated_at"='2021-10-18 19:50:09.438' WHERE id = 100 AND "users"."deleted_at" IS NULL`, sql)
    
    	// UpdateColumn
    	sql = DB.ToSQL(func(tx *gorm.DB) *gorm.DB {
    		return tx.Model(&User{}).Where("id = ?", 100).UpdateColumn("name", "Foo bar")
    	})
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 16.7K bytes
    - Viewed (0)
  2. tests/associations_test.go

    	id := uint(100)
    	user := AssociationEmptyUser{
    		ID:   id,
    		Name: "jinzhu",
    		Pets: []AssociationEmptyPet{
    			{AssociationEmptyUserID: &id, Name: "bar"},
    			{AssociationEmptyUserID: &id, Name: "foo"},
    		},
    	}
    
    	err := DB.Session(&gorm.Session{FullSaveAssociations: true}).Create(&user).Error
    	if err != nil {
    		t.Fatalf("Failed to create, got error: %v", err)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Feb 08 08:29:09 GMT 2023
    - 10.9K bytes
    - Viewed (0)
Back to top