Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for p2 (0.13 sec)

  1. tests/hooks_test.go

    	if DB.Save(&Product{Code: "dont_save", Price: 100}).Error == nil {
    		t.Fatalf("An error from after create callbacks happened when create with invalid value")
    	}
    
    	p2 := Product{Code: "update_callback", Price: 100}
    	DB.Save(&p2)
    
    	p2.Code = "dont_update"
    	if DB.Save(&p2).Error == nil {
    		t.Fatalf("An error from before update callbacks happened when update with invalid value")
    	}
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Feb 18 01:20:29 GMT 2023
    - 15.9K bytes
    - Viewed (0)
  2. tests/preload_test.go

    	DB.Migrator().AutoMigrate(&Preload{}, &Join{}, &Nested{}, &Value{})
    
    	value1 := Value{
    		Name: "value",
    		Nested: Nested{
    			Preloads: []*Preload{
    				{Value: "p1"}, {Value: "p2"},
    			},
    			Join: Join{Value: "j1"},
    		},
    	}
    	value2 := Value{
    		Name: "value2",
    		Nested: Nested{
    			Preloads: []*Preload{
    				{Value: "p3"}, {Value: "p4"}, {Value: "p5"},
    			},
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 14.9K bytes
    - Viewed (0)
  3. tests/query_test.go

    	}
    
    	p1 := CustomizedTypePrimaryKey{Name: "p1"}
    	p2 := CustomizedTypePrimaryKey{Name: "p2"}
    	p3 := CustomizedTypePrimaryKey{Name: "p3"}
    	DB.Create(&p1)
    	DB.Create(&p2)
    	DB.Create(&p3)
    
    	var p CustomizedTypePrimaryKey
    
    	if err := DB.First(&p, p2.ID).Error; err != nil {
    		t.Errorf("No error should returns, but got %v", err)
    	}
    
    	AssertEqual(t, p, p2)
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 49.8K bytes
    - Viewed (0)
  4. logger/sql_test.go

    		},
    		{
    			SQL:           "create table users (name, age, height, actived, bytes, create_at, update_at, deleted_at, email, role, pass) values (@p1, @p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9, @p10, @p11)",
    			NumericRegexp: regexp.MustCompile(`@p(\d+)`),
    			Vars:          []interface{}{"jinzhu", 1, 999.99, true, []byte("12345"), tt, &tt, nil, "******@****.***", myrole, pwd},
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Mar 21 08:00:02 GMT 2024
    - 8.4K bytes
    - Viewed (0)
Back to top