Documentation ¶
Overview ¶
Thread safe engine for MyMySQL
In contrast to native engine:
- one connection can be used by multiple gorutines,
- if connection is idle pings are sent to the server (once per minute) to avoid timeout.
See documentation of mymysql/native for details
Index ¶
- func New(proto, laddr, raddr, user, passwd string, db ...string) mysql.Conn
- type Conn
- func (c *Conn) Begin() (mysql.Transaction, error)
- func (c *Conn) Clone() mysql.Conn
- func (c *Conn) Close() error
- func (c *Conn) Connect() error
- func (c *Conn) Ping() error
- func (c *Conn) Prepare(sql string) (mysql.Stmt, error)
- func (c *Conn) Query(sql string, params ...interface{}) ([]mysql.Row, mysql.Result, error)
- func (my *Conn) QueryFirst(sql string, params ...interface{}) (mysql.Row, mysql.Result, error)
- func (my *Conn) QueryLast(sql string, params ...interface{}) (mysql.Row, mysql.Result, error)
- func (c *Conn) Reconnect() error
- func (c *Conn) Start(sql string, params ...interface{}) (mysql.Result, error)
- func (c *Conn) Use(dbname string) error
- type Result
- func (res *Result) End() error
- func (res *Result) GetFirstRow() (mysql.Row, error)
- func (res *Result) GetLastRow() (mysql.Row, error)
- func (res *Result) GetRow() (mysql.Row, error)
- func (res *Result) GetRows() ([]mysql.Row, error)
- func (res *Result) NextResult() (mysql.Result, error)
- func (res *Result) ScanRow(row mysql.Row) error
- type Stmt
- func (stmt *Stmt) Delete() error
- func (stmt *Stmt) Exec(params ...interface{}) ([]mysql.Row, mysql.Result, error)
- func (stmt *Stmt) ExecFirst(params ...interface{}) (mysql.Row, mysql.Result, error)
- func (stmt *Stmt) ExecLast(params ...interface{}) (mysql.Row, mysql.Result, error)
- func (stmt *Stmt) Reset() error
- func (stmt *Stmt) Run(params ...interface{}) (mysql.Result, error)
- func (stmt *Stmt) SendLongData(pnum int, data interface{}, pkt_size int) error
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Conn ¶
func (*Conn) QueryFirst ¶
See mysql.QueryFirst
type Result ¶
func (*Result) GetFirstRow ¶
See mysql.GetFirstRow
type Stmt ¶
type Transaction ¶
type Transaction struct { *Conn // contains filtered or unexported fields }
func (*Transaction) Commit ¶
func (tr *Transaction) Commit() error
func (*Transaction) IsValid ¶
func (tr *Transaction) IsValid() bool
func (*Transaction) Rollback ¶
func (tr *Transaction) Rollback() error
Click to show internal directories.
Click to hide internal directories.