Versions in this module Expand all Collapse all v1 v1.1.3 Sep 11, 2020 Changes in this version + const DefaultConnMaxLifetime + const DefaultMaxIdleConns + func WithIndex(ctx context.Context, idx int64) context.Context + type Config struct + ConnMaxLifetime time.Duration + DSN string + DSNSlave string + Instances []ConfigInstance + MaxIdleConns int + MaxOpenConns int + Mod int64 + type ConfigInstance struct + Buckets []int64 + DSN string + DSNSlave string + type Factory struct + func NewFactory(config *Config) *Factory + func Register(section string) **Factory + func (f *Factory) Close() error + func (f *Factory) Conn(ctx context.Context) (err error) + func (f *Factory) New(ctx context.Context) *MySQL + type MySQL struct + func New(ctx context.Context) *MySQL + func (mysql *MySQL) BeginTx(opts *sql.TxOptions) (tx *Tx, err error) + func (mysql *MySQL) Exec(query string, args ...interface{}) (result Result, err error) + func (mysql *MySQL) Ping() (err error) + func (mysql *MySQL) Prepare(query string) (stmt *Stmt, err error) + func (mysql *MySQL) Query(query string, args ...interface{}) (rows *Rows, err error) + func (mysql *MySQL) QueryRow(query string, args ...interface{}) (row *Row, err error) + func (mysql *MySQL) Stats() sql.DBStats + func (mysql *MySQL) UseMaster() *MySQL + type Result sql.Result + type Row struct + func (r *Row) Scan(dest ...interface{}) error + type Rows struct + func (rs *Rows) Close() error + func (rs *Rows) ColumnTypes() ([]*sql.ColumnType, error) + func (rs *Rows) Columns() ([]string, error) + func (rs *Rows) Err() error + func (rs *Rows) Next() bool + func (rs *Rows) NextResultSet() bool + func (rs *Rows) Scan(dest ...interface{}) error + type Stmt struct + func (s *Stmt) Close() error + func (s *Stmt) Exec(args ...interface{}) (result Result, err error) + func (s *Stmt) Query(args ...interface{}) (rows *Rows, err error) + func (s *Stmt) QueryRow(args ...interface{}) (row *Row, err error) + type Tx struct + func (tx *Tx) Commit() (err error) + func (tx *Tx) Exec(query string, args ...interface{}) (result Result, err error) + func (tx *Tx) Prepare(query string) (stmt *Stmt, err error) + func (tx *Tx) Query(query string, args ...interface{}) (rows *Rows, err error) + func (tx *Tx) QueryRow(query string, args ...interface{}) (row *Row, err error) + func (tx *Tx) Rollback() error + func (tx *Tx) Stmt(stmt *Stmt) (txStmt *Stmt, err error)