orm

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoRow          = sql.ErrNoRows
	ErrRecordNotFound = gorm.ErrRecordNotFound
)

Functions

func InitGormV2

func InitGormV2(c *MySQLConfig) (db *gorm.DB)

Types

type MySQLConfig

type MySQLConfig struct {
	DSN            string          // data source name.
	MaxOpenConn    int             // pool, e.g:10
	MaxIdleConn    int             // pool, e.g:100
	MaxConnTimeout xtime.Duration  // connect max life time. e.g:10s、2m、1m10s
	LogLevel       logger.LogLevel // Silent、Info、Warn、Error, default Warn
	SlowThreshold  xtime.Duration  // slow sql log. e.g:100ms、200ms、300ms、1s, default 200ms
}

MySQLConfig mysql config.

Jump to

Keyboard shortcuts

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