tgorm

package
v0.0.0-...-0450a86 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2019 License: GPL-3.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCommitter

func NewCommitter() connector.Committer

NewCommitter get trellis gorm committer

func NewGormDBsFromConfig

func NewGormDBsFromConfig(conf config.Configuration, name string) (map[string]*gorm.DB, error)

NewGormDBsFromConfig initial gorm engine from config

func NewGormDBsFromFile

func NewGormDBsFromFile(file string) (map[string]*gorm.DB, error)

NewGormDBsFromFile initial gorm dbs from file

Types

type Committer

type Committer struct {
	Name string
}

Committer gorm committer

func (*Committer) NonTX

func (p *Committer) NonTX(fn interface{}, repos ...interface{}) errors.ErrCode

NonTX do non transaction function by default database

func (*Committer) NonTXWithName

func (p *Committer) NonTXWithName(fn interface{}, name string, repos ...interface{}) errors.ErrCode

NonTXWithName do non transaction function with name of database

func (*Committer) TX

func (p *Committer) TX(fn interface{}, repos ...interface{}) errors.ErrCode

TX do transaction function by default database

func (*Committer) TXWithName

func (p *Committer) TXWithName(fn interface{}, name string, repos ...interface{}) errors.ErrCode

TXWithName do transaction function with name of database

type TGorm

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

TGorm trellis gorm

func (*TGorm) Session

func (p *TGorm) Session() *gorm.DB

Session get session

func (*TGorm) SetDBs

func (p *TGorm) SetDBs(dbs map[string]*gorm.DB)

SetDBs set gorm dbs

Jump to

Keyboard shortcuts

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