database

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractDB

func ExtractDB(ctx context.Context) (*gorm.DB, error)

ExtractDB is used by other repo to extract the database from context

func NewGormPostgres

func NewGormPostgres() *gorm.DB

Types

type GormWithTrxImpl

type GormWithTrxImpl struct {
	DB *gorm.DB
}

GormWithTrxImpl ...

func NewGormWithTrxImpl

func NewGormWithTrxImpl(db *gorm.DB) *GormWithTrxImpl

NewGormWithTrxImpl ...

func (*GormWithTrxImpl) BeginTransaction

func (r *GormWithTrxImpl) BeginTransaction(ctx context.Context) (context.Context, error)

BeginTransaction ...

func (*GormWithTrxImpl) CommitTransaction

func (r *GormWithTrxImpl) CommitTransaction(ctx context.Context) error

CommitTransaction ...

func (*GormWithTrxImpl) RollbackTransaction

func (r *GormWithTrxImpl) RollbackTransaction(ctx context.Context) error

RollbackTransaction ...

type GormWithoutTrxImpl

type GormWithoutTrxImpl struct {
	DB *gorm.DB
}

GormWithoutTrxImpl ...

func NewGormWithoutTrxImpl

func NewGormWithoutTrxImpl(db *gorm.DB) *GormWithoutTrxImpl

NewGormWithoutTrxImpl ...

func (*GormWithoutTrxImpl) GetDatabase

func (r *GormWithoutTrxImpl) GetDatabase(ctx context.Context) (context.Context, error)

GetDatabase ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL