mysql

package
v0.0.0-...-64afd39 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_CONNECTION = "default"

Variables

View Source
var Clients map[string]*gorm.DB

Functions

func CausedByLostConnection

func CausedByLostConnection(err error) bool

func CloseClients

func CloseClients()

func Create

func Create(connection string) *gorm.DB

func CreateDefault

func CreateDefault() *gorm.DB

func Setup

func Setup()

Types

type ConnWrapper

type ConnWrapper struct {
	*gorm.DB
	InTransaction bool
}

func Connection

func Connection(connection string) *ConnWrapper

func DefaultConnection

func DefaultConnection() *ConnWrapper

func (*ConnWrapper) BeginTx

func (cw *ConnWrapper) BeginTx(opts ...*sql.TxOptions) *ConnWrapper

func (*ConnWrapper) CommitTx

func (cw *ConnWrapper) CommitTx(originCw *ConnWrapper) *ConnWrapper

func (*ConnWrapper) Txn

func (cw *ConnWrapper) Txn(fc func(tx *ConnWrapper) error, opts ...*sql.TxOptions) error

Jump to

Keyboard shortcuts

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