Documentation ¶
Index ¶
- Constants
- Variables
- type DB
- func (d *DB) Charset() string
- func (d *DB) ConnMaxDuration() time.Duration
- func (d *DB) Description() string
- func (d *DB) GetByKey(key string) (string, bool)
- func (d *DB) SetConn(setter DBConnSetter) error
- func (d *DB) SetDebug(on bool)
- func (d *DB) SetKV(key string, value string) *DB
- func (d *DB) Table(table string) string
- func (d *DB) ToMySQL() mysql.ConnectionURL
- func (d *DB) ToTable(m sqlbuilder.Name_) string
- type DBConnSetter
Constants ¶
View Source
const MySQLDefaultCharset = `utf8mb4`
Variables ¶
View Source
var ( MySQLSupportCharsetList = []string{ MySQLDefaultCharset, `utf8`, } )
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct { Type string `json:"type"` User string `json:"user"` Password string `json:"password"` Host string `json:"host"` Database string `json:"database"` Prefix string `json:"prefix"` Options map[string]string `json:"options"` Debug bool `json:"debug"` ConnMaxLifetime string `json:"connMaxLifetime"` //example: 10s MaxIdleConns int `json:"maxIdleConns"` MaxOpenConns int `json:"maxOpenConns"` // contains filtered or unexported fields }
func (*DB) ConnMaxDuration ¶
func (*DB) Description ¶
func (*DB) SetConn ¶
func (d *DB) SetConn(setter DBConnSetter) error
func (*DB) ToMySQL ¶
func (d *DB) ToMySQL() mysql.ConnectionURL
Click to show internal directories.
Click to hide internal directories.