Versions in this module Expand all Collapse all v1 v1.5.1 Feb 7, 2022 Changes in this version + var DefaultIdleTimeout = 30 * time.Second + var MaxIdleTimeoutWithoutPing = 10 * time.Second + var MaxNewConnectionAtOnce = 5 + func NewClientTLSConfig(caPem, certPem, keyPem []byte, insecureSkipVerify bool, serverName string) *tls.Config + type Conn struct + func Connect(addr string, user string, password string, dbName string, ...) (*Conn, error) + func ConnectWithDialer(ctx context.Context, network string, addr string, user string, password string, ...) (*Conn, error) + func (c *Conn) Begin() error + func (c *Conn) Close() error + func (c *Conn) Commit() error + func (c *Conn) Execute(command string, args ...interface{}) (*Result, error) + func (c *Conn) ExecuteMultiple(query string, perResultCallback ExecPerResultCallback) (*Result, error) + func (c *Conn) ExecuteSelectStreaming(command string, result *Result, perRowCallback SelectPerRowCallback, ...) error + func (c *Conn) FieldList(table string, wildcard string) ([]*Field, error) + func (c *Conn) GetCharset() string + func (c *Conn) GetConnectionID() uint32 + func (c *Conn) GetDB() string + func (c *Conn) HandleErrorPacket(data []byte) error + func (c *Conn) HandleOKPacket(data []byte) *Result + func (c *Conn) IsAutoCommit() bool + func (c *Conn) IsInTransaction() bool + func (c *Conn) Ping() error + func (c *Conn) Prepare(query string) (*Stmt, error) + func (c *Conn) ReadOKPacket() (*Result, error) + func (c *Conn) Rollback() error + func (c *Conn) SetAutoCommit() error + func (c *Conn) SetCapability(cap uint32) + func (c *Conn) SetCharset(charset string) error + func (c *Conn) SetTLSConfig(config *tls.Config) + func (c *Conn) UnsetCapability(cap uint32) + func (c *Conn) UseDB(dbName string) error + func (c *Conn) UseSSL(insecureSkipVerify bool) + type Connection struct + type ConnectionStats struct + CreatedCount int64 + IdleCount int + TotalCount int + type Dialer func(ctx context.Context, network, address string) (net.Conn, error) + type ExecPerResultCallback func(result *Result, err error) + type LogFunc func(format string, args ...interface{}) + type Pool struct + func NewPool(logFunc LogFunc, minAlive int, maxAlive int, maxIdle int, addr string, ...) *Pool + func (pool *Pool) DropConn(conn *Conn) + func (pool *Pool) GetConn(ctx context.Context) (*Conn, error) + func (pool *Pool) GetStats(stats *ConnectionStats) + func (pool *Pool) PutConn(conn *Conn) + type SelectPerResultCallback func(result *Result) error + type SelectPerRowCallback func(row []FieldValue) error + type Stmt struct + func (s *Stmt) Close() error + func (s *Stmt) ColumnNum() int + func (s *Stmt) Execute(args ...interface{}) (*Result, error) + func (s *Stmt) ExecuteSelectStreaming(result *Result, perRowCb SelectPerRowCallback, ...) error + func (s *Stmt) ParamNum() int + func (s *Stmt) WarningsNum() int + type Timestamp int64