package thrsafe
import "github.com/ziutek/mymysql/thrsafe"
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
Functions ¶
func New ¶
Types ¶
type Conn ¶
func (*Conn) Begin ¶
func (c *Conn) Begin() (mysql.Transaction, error)
func (*Conn) Clone ¶
func (*Conn) Close ¶
func (*Conn) Connect ¶
func (*Conn) Ping ¶
func (*Conn) Prepare ¶
func (*Conn) Query ¶
See mysql.Query
func (*Conn) QueryFirst ¶
See mysql.QueryFirst
func (*Conn) QueryLast ¶
See mysql.QueryLast
func (*Conn) Reconnect ¶
func (*Conn) Start ¶
func (*Conn) Use ¶
type Result ¶
func (*Result) End ¶
See mysql.End
func (*Result) GetFirstRow ¶
See mysql.GetFirstRow
func (*Result) GetLastRow ¶
See mysql.GetLastRow
func (*Result) GetRow ¶
func (*Result) GetRows ¶
See mysql.GetRows
func (*Result) NextResult ¶
func (*Result) ScanRow ¶
type Stmt ¶
func (*Stmt) Delete ¶
func (*Stmt) Exec ¶
See mysql.Exec
func (*Stmt) ExecFirst ¶
See mysql.ExecFirst
func (*Stmt) ExecLast ¶
See mysql.ExecLast
func (*Stmt) Reset ¶
func (*Stmt) Run ¶
func (*Stmt) SendLongData ¶
type Transaction ¶
type Transaction struct { *Conn // contains filtered or unexported fields }
func (*Transaction) Commit ¶
func (tr *Transaction) Commit() error
func (*Transaction) Do ¶
func (tr *Transaction) Do(st mysql.Stmt) mysql.Stmt
func (*Transaction) Rollback ¶
func (tr *Transaction) Rollback() error
Source Files ¶
- Version
- v0.4.10
- Published
- Sep 10, 2012
- Platform
- windows/amd64
- Imports
- 5 packages
- Last checked
- 1 hour ago –
Tools for package owners.