Skip to content

Guiwoo/TestDBWrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is for the Repository Test Transaction RollBack

Do not want to write a code every single time when I create a new Project.

How To Use

func Test_Rollback(t *testing.T) {
	testDB := NewTestDB(&gorm.DB{})
    
	testDB.RunWithRollback(func(tx *gorm.DB) error) error {
        // Do something with tx
        return nil
    })
}

About

This is For the test db wrapper with gorm

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages