Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(conf sqlcommon.ConfigInterface) sqlcommon.Connector
New init new mysql connection
func WithClient ¶ added in v0.3.6
WithClient launch MySQL connection pool
Types ¶
type Config ¶
type Config struct {
Pool []Item `yaml:"mysql"`
}
Config pool of configs
func (*Config) List ¶
func (c *Config) List() (list []sqlcommon.ItemInterface)
List getting all configs
type ConfigMysql ¶
type ConfigMysql struct { Pool []Item `yaml:"mysql"` Migrate []orm.ConfigMigrateItem `yaml:"mysql_migrate"` }
ConfigMysql mysql config model
func (*ConfigMysql) Default ¶
func (v *ConfigMysql) Default()
func (*ConfigMysql) List ¶
func (v *ConfigMysql) List() (list []sqlcommon.ItemInterface)
List getting all configs
type Item ¶
type Item struct { Name string `yaml:"name"` Host string `yaml:"host"` Port int `yaml:"port"` Schema string `yaml:"schema"` User string `yaml:"user"` Password string `yaml:"password"` Timezone string `yaml:"timezone"` TxIsolationLevel string `yaml:"txisolevel"` Charset string `yaml:"charset"` Collation string `yaml:"collation"` MaxIdleConn int `yaml:"maxidleconn"` MaxOpenConn int `yaml:"maxopenconn"` InterpolateParams bool `yaml:"interpolateparams"` MaxConnTTL time.Duration `yaml:"maxconnttl"` Timeout time.Duration `yaml:"timeout"` ReadTimeout time.Duration `yaml:"readtimeout"` WriteTimeout time.Duration `yaml:"writetimeout"` OtherParams string `yaml:"other_params"` }
Item config model
func (Item) Setup ¶
func (i Item) Setup(s sqlcommon.SetupInterface)
Setup setting config conntections params
Click to show internal directories.
Click to hide internal directories.