Documentation
¶
Index ¶
- func NewDataBase(driver string, host string, port uint, dbname string, instanceName string, ...) (*xorm.Engine, error)
- type DataSourceTypeName
- type Option
- func SetConnMaxLifetime(maxlifetime time.Duration) Option
- func SetLogLevel(logLevel log.LogLevel) Option
- func SetLogger(logger interface{}) Option
- func SetMapper(mapper names.Mapper) Option
- func SetMaxIdleConns(maxIdleConns int) Option
- func SetMaxOpenConns(maxOpenConns int) Option
- func SetShowSQL(showSQL ...bool) 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 xorm.Engine
func SetConnMaxLifetime ¶
func SetLogLevel ¶
func SetMaxIdleConns ¶
func SetMaxOpenConns ¶
func SetShowSQL ¶
type OptionFunc ¶
OptionFunc is a function that configures a xorm.Engine
func (OptionFunc) Apply ¶
func (f OptionFunc) Apply(engine *xorm.Engine)
Apply is a function that set value to xorm.Engine
Click to show internal directories.
Click to hide internal directories.