package autorc
import "github.com/ziutek/mymysql/autorc"
Auto reconnect interface for MyMySQL
Index ¶
- func IsNetErr(err error) bool
- type Conn
- func New(proto, laddr, raddr, user, passwd string, db ...string) *Conn
- func (c *Conn) Prepare(sql string) (*Stmt, error)
- func (c *Conn) Query(sql string, params ...interface{}) (rows []mysql.Row, res mysql.Result, err error)
- func (c *Conn) Use(dbname string) (err error)
- type Stmt
Functions ¶
func IsNetErr ¶
Return true if error is network error or UnexpectedEOF.
Types ¶
type Conn ¶
type Conn struct { Raw mysql.Conn // Maximum reconnect retries. // Default is 7 which means 1+2+3+4+5+6+7 = 28 seconds before return error. MaxRetries int // Debug logging. You may change it at any time. Debug bool }
func New ¶
func (*Conn) Prepare ¶
Automatic connect/reconnect/repeat version of Prepare
func (*Conn) Query ¶
func (c *Conn) Query(sql string, params ...interface{}) (rows []mysql.Row, res mysql.Result, err error)
Automatic connect/reconnect/repeat version of Query
func (*Conn) Use ¶
Automatic connect/reconnect/repeat version of Use
type Stmt ¶
func (*Stmt) Exec ¶
Automatic connect/reconnect/repeat version of Exec
Source Files ¶
- Version
- v0.4.1
- Published
- Jan 13, 2012
- Platform
- windows/amd64
- Imports
- 5 packages
- Last checked
- 1 hour ago –
Tools for package owners.