modulepackage
0.0.0-20190212141510-b14e7f9186b2
Repository: https://github.com/go-mysql/conn.git
Documentation: pkg.go.dev
# README
go-mysql/conn
Do not use this repo. Use database/sql.Conn.
For MySQL error handling, use go-mysql/errors.
# Functions
Down returns true if the error indicates MySQL cannot be reached for any reason, probably because it's not running.
Lost returns true if the error indicates the MySQL connection was lost for any reason.
MySQLErrorCode returns the MySQL server error code for the error, or zero if the error is not a MySQL error.
NewPool creates a new pool using the given, pre-configured sql.DB.
# Variables
ErrConnCannotConnect is returned when a connection cannot be made because MySQL is down or unreachable for any reason.
ErrConnLost is returned when the connection is lost, closed, or killed for any reason.
ErrDupeKey is returned when a unique index prevents a value from being inserted or updated.
ErrQueryKilled is returned when the KILL QUERY command is used.
ErrReadOnly is returned when MySQL read-only is enabled.
ErrTimeout is returned when a context timeout happens.
# Interfaces
A Connector creates sql.Conn without exposing how connections are made.