Skip to content

VladimirStepanov/pgxtransactor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is that?

pgxtransactgor is a library for using a common transaction connection between repository method calls

How to use it?

//...
txManager.RunRepeatableRead(ctx, func(dbCtx context.Context) error {
    product, err := repo.GetProduct(dbCtx, 1)
    if err != nil {
        return err
    }
    // some data processing
    product.Price += 10000
    return repo.UpdateProduct(dbCtx, product)
})

Full example in ./example directory

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages