pgd

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//ConnWrapperTypeID type id
	ConnWrapperTypeID = "ffc08507-dd5f-456c-84ea-cdbf00b220b0"
)
View Source
const (
	//DaoBaseTypeID type id
	DaoBaseTypeID = "4d6adee7-7c10-4471-8885-a589688bac93"
)

Variables

This section is empty.

Functions

func ConnWrapperTypeLives

func ConnWrapperTypeLives() []*dot.TypeLives

ConnWrapperTypeLives make all type lives

func DaoBaseTypeLives

func DaoBaseTypeLives() []*dot.TypeLives

DaoBaseTypeLives make all type lives

Types

type ConnWrapper

type ConnWrapper struct {
	// contains filtered or unexported fields
}

ConnWrapper connect wrapper

func GenerateConnWrapper

func GenerateConnWrapper(conf string) *ConnWrapper

GenerateConnWrapper this func is for test

func GenerateConnWrapperByDb

func GenerateConnWrapperByDb(db *bun.DB) *ConnWrapper

GenerateConnWrapperByDb this func is for test

func (*ConnWrapper) AfterAllDestroy

func (c *ConnWrapper) AfterAllDestroy(dot.Line)

func (*ConnWrapper) Create

func (c *ConnWrapper) Create(dot.Line) error

func (*ConnWrapper) GetDb

func (c *ConnWrapper) GetDb() *bun.DB

GetDb get db

func (*ConnWrapper) RunInNoTx

func (c *ConnWrapper) RunInNoTx(task func(db bun.IDB) error) error

func (*ConnWrapper) RunInTx

func (c *ConnWrapper) RunInTx(task func(db bun.IDB) error) error

func (*ConnWrapper) TestConn

func (c *ConnWrapper) TestConn() bool

TestConn test the connect

type DaoBase

type DaoBase struct {
	Wrapper *ConnWrapper `dot:""`
}

DaoBase doa base

func GenerateDaoBase

func GenerateDaoBase(conf string) *DaoBase

GenerateDaoBase this func is for test

func GenerateDaoBaseByDb

func GenerateDaoBaseByDb(db *bun.DB) *DaoBase

GenerateDaoBaseByDb this func is for test

func (*DaoBase) WithNoTx

func (c *DaoBase) WithNoTx(task func(conn bun.IDB) error) error

WithNoTx no transaction

func (*DaoBase) WithTx

func (c *DaoBase) WithTx(task func(conn bun.IDB) error) error

WithTx with transaction, if return err != nil then rollback, or commit the transaction

Jump to

Keyboard shortcuts

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