Documentation ¶
Index ¶
- func NewClientTLSConfig(caPem, certPem, keyPem []byte, insecureSkipVerify bool, serverName string) *tls.Config
- type Conn
- 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) 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) GetStatus() uint16
- 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(autocommit bool) error
- func (c *Conn) SetCharset(charset string) error
- func (c *Conn) SetTLSConfig(config *tls.Config)
- func (c *Conn) StmtClosePrepare(stmtId int) error
- func (c *Conn) StmtExecuteForward(data []byte) (*Result, error)
- func (c *Conn) StmtPrepare(query string) (driver.Stmt, error)
- func (c *Conn) UseDB(dbName string) error
- func (c *Conn) UseSSL(insecureSkipVerify bool)
- type Stmt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Conn ¶
func Connect ¶
func Connect(addr string, user string, password string, dbName string, options ...func(*Conn)) (*Conn, error)
Connect to a MySQL server, addr can be ip:port, or a unix socket domain like /var/sock. Accepts a series of configuration functions as a variadic argument.
func (*Conn) GetCharset ¶
func (*Conn) GetConnectionID ¶
func (*Conn) HandleErrorPacket ¶
func (*Conn) HandleOKPacket ¶
func (*Conn) IsAutoCommit ¶
func (*Conn) IsInTransaction ¶
func (*Conn) ReadOKPacket ¶
func (*Conn) SetAutoCommit ¶
func (*Conn) SetCharset ¶
func (*Conn) SetTLSConfig ¶
SetTLSConfig: use user-specified TLS config pass to options when connect
func (*Conn) StmtClosePrepare ¶
func (*Conn) StmtExecuteForward ¶
TODO(eastfisher): currently only support COM_STMT_EXECUTE
Click to show internal directories.
Click to hide internal directories.