Documentation
¶
Index ¶
- func NewDataBase(driver, host string, port uint, dbname, instanceName string, ...) (*gorm.DB, error)
- type DataSourceTypeName
- type Option
- func SetConnMaxIdleTime(maxIdleTime time.Duration) Option
- func SetConnMaxLifetime(maxlifetime time.Duration) Option
- func SetLogLevel(logLevel logger.LogLevel) Option
- func SetLogger(logger logger.Interface) Option
- func SetMaxIdleConns(maxIdleConns int) Option
- func SetMaxOpenConns(maxOpenConns int) Option
- type OptionFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DataSourceTypeName ¶
type DataSourceTypeName string
const ( CloudMySql DataSourceTypeName = "cloud_mysql" Mysql DataSourceTypeName = "mysql" Postgresql DataSourceTypeName = "postgres" Sqlite DataSourceTypeName = "sqlite" )
type Option ¶
An Option configures a gorm.DB
func SetConnMaxIdleTime ¶ added in v1.2.0
func SetConnMaxLifetime ¶
func SetLogLevel ¶
func SetMaxIdleConns ¶
func SetMaxOpenConns ¶
Click to show internal directories.
Click to hide internal directories.