dbwrap

package module
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2021 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close() error

func CommonDB

func CommonDB() *sql.DB

func Db

func Db() *gorm.DB

func IsRecordNotFoundError

func IsRecordNotFoundError(err error) bool

func Keepalive

func Keepalive(ctx context.Context, interval time.Duration)

func Open

func Open() (err error)

func OpenUntilOk

func OpenUntilOk(retryInterval time.Duration) bool

Types

type AssociationFunc

type AssociationFunc func(*gorm.DB) *gorm.DB

type DbMgt

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

func CreateTables

func CreateTables(models ...interface{}) *DbMgt

func DefaultDbMgt

func DefaultDbMgt() *DbMgt

func New

func New(debug bool, cfg *gorm.Config) *DbMgt

func OpenUntilOkAndCreateTables

func OpenUntilOkAndCreateTables(retryInterval time.Duration, models ...interface{}) *DbMgt

func OpenUntilOkAndDropTableIfExistsThenCreateTables

func OpenUntilOkAndDropTableIfExistsThenCreateTables(retryInterval time.Duration, models ...interface{}) *DbMgt

func Register

func Register(models ...interface{}) *DbMgt

func RegisterAssociationFunc

func RegisterAssociationFunc(funcs ...AssociationFunc) *DbMgt

func SetDbParam

func SetDbParam(host, port, user, password, name string, ssl bool) *DbMgt

func SetMysqlParam

func SetMysqlParam(host, port, user, password, name, charset, loc string, parseTime bool) *DbMgt

func SetPgParam

func SetPgParam(host, port, user, password, name string, ssl bool) *DbMgt

func SetSqlServerParam

func SetSqlServerParam(host, port, user, password, name string) *DbMgt

func SetSqlite3Param

func SetSqlite3Param(path string) *DbMgt

func (*DbMgt) Close

func (c *DbMgt) Close() error

func (*DbMgt) CommonDB

func (c *DbMgt) CommonDB() *sql.DB

func (*DbMgt) CreateTables

func (c *DbMgt) CreateTables(models ...interface{}) *DbMgt

func (*DbMgt) Db

func (c *DbMgt) Db() *gorm.DB

func (*DbMgt) DropTableIfExists

func (c *DbMgt) DropTableIfExists(models ...interface{}) *DbMgt

func (*DbMgt) Keepalive

func (c *DbMgt) Keepalive(ctx context.Context, interval time.Duration)

func (*DbMgt) Open

func (c *DbMgt) Open() error

func (*DbMgt) OpenUntilOk

func (c *DbMgt) OpenUntilOk(retryInterval time.Duration) bool

func (*DbMgt) OpenUntilOkAndCreateTables

func (c *DbMgt) OpenUntilOkAndCreateTables(retryInterval time.Duration, models ...interface{}) *DbMgt

func (*DbMgt) OpenUntilOkAndDropTableIfExistsThenCreateTables

func (c *DbMgt) OpenUntilOkAndDropTableIfExistsThenCreateTables(retryInterval time.Duration, models ...interface{}) *DbMgt

func (*DbMgt) Register

func (c *DbMgt) Register(models ...interface{}) *DbMgt

func (*DbMgt) RegisterAssociationFunc

func (c *DbMgt) RegisterAssociationFunc(funcs ...AssociationFunc) *DbMgt

func (*DbMgt) SetDbParam

func (c *DbMgt) SetDbParam(host, port, user, password, name string, ssl bool) *DbMgt

func (*DbMgt) SetMysqlParam

func (c *DbMgt) SetMysqlParam(host, port, user, password, name, charset, loc string, parseTime bool) *DbMgt

func (*DbMgt) SetPgParam

func (c *DbMgt) SetPgParam(host, port, user, password, name string, ssl bool) *DbMgt

func (*DbMgt) SetSqlServerParam

func (c *DbMgt) SetSqlServerParam(host, port, user, password, name string) *DbMgt

func (*DbMgt) SetSqlite3Param

func (c *DbMgt) SetSqlite3Param(path string) *DbMgt

Jump to

Keyboard shortcuts

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