Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for db (0.29 sec)

  1. tests/create_test.go

    		}}
    
    		if err := DB.Create(&pets).Error; err != nil {
    			t.Fatalf("errors happened when create: %v", err)
    		}
    
    		for _, pet := range pets {
    			CheckPet(t, *pet, *pet)
    		}
    	})
    }
    
    func TestCreateEmptyStruct(t *testing.T) {
    	type EmptyStruct struct {
    		ID uint
    	}
    	DB.Migrator().DropTable(&EmptyStruct{})
    
    	if err := DB.AutoMigrate(&EmptyStruct{}); err != nil {
    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. callbacks/create_test.go

    		{
    			ID:    1,
    			Name:  "alice",
    			Email: "email",
    			Age:   18,
    		},
    		{
    			ID:    2,
    			Name:  "bob",
    			Email: "email",
    			Age:   19,
    		},
    	}
    	stmt := &gorm.Statement{
    		DB: &gorm.DB{
    			Config: &gorm.Config{
    				NowFunc: func() time.Time { return time.Time{} },
    			},
    			Statement: &gorm.Statement{
    				Settings: sync.Map{},
    				Schema:   s,
    			},
    		},
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 05:48:42 GMT 2024
    - 1.4K bytes
    - Viewed (0)
Back to top