Versions in this module Expand all Collapse all v0 v0.4.5 Apr 5, 2012 Changes in this version + const BIGINT + const BLOB + const CHAR + const DATE + const DATETIME + const DOUBLE + const FLOAT + const INT + const IN_BINARY + const IN_BIT + const IN_DECIMAL + const IN_LONGBLOB + const IN_LONGTEXT + const IN_MEDIUMBLOB + const IN_MEDIUMINT + const IN_MEDIUMTEXT + const IN_TEXT + const IN_TINYBLOB + const IN_TINYTEXT + const IN_VARBINARY + const IN_VARCHAR + const IN_YEAR + const MYSQL_TYPE_BIT + const MYSQL_TYPE_BLOB + const MYSQL_TYPE_DATE + const MYSQL_TYPE_DATETIME + const MYSQL_TYPE_DECIMAL + const MYSQL_TYPE_DOUBLE + const MYSQL_TYPE_ENUM + const MYSQL_TYPE_FLOAT + const MYSQL_TYPE_GEOMETRY + const MYSQL_TYPE_INT24 + const MYSQL_TYPE_LONG + const MYSQL_TYPE_LONGLONG + const MYSQL_TYPE_LONG_BLOB + const MYSQL_TYPE_MEDIUM_BLOB + const MYSQL_TYPE_NEWDATE + const MYSQL_TYPE_NEWDECIMAL + const MYSQL_TYPE_NULL + const MYSQL_TYPE_SET + const MYSQL_TYPE_SHORT + const MYSQL_TYPE_STRING + const MYSQL_TYPE_TIME + const MYSQL_TYPE_TIMESTAMP + const MYSQL_TYPE_TINY + const MYSQL_TYPE_TINY_BLOB + const MYSQL_TYPE_VARCHAR + const MYSQL_TYPE_VAR_STRING + const MYSQL_TYPE_YEAR + const MYSQL_UNSIGNED_MASK + const NULL + const OUT_BINARY + const OUT_TEXT + const OUT_VARBINARY + const OUT_VARCHAR + const SMALLINT + const TIME + const TIMESTAMP + const TINYINT + var ALREDY_CONN_ERROR = errors.New("not connected") + var BAD_COMMAND_ERROR = errors.New("comand isn't text SQL nor *Stmt") + var BAD_RESULT_ERROR = errors.New("unexpected result") + var BIND_COUNT_ERROR = errors.New("wrong number of values for bind") + var BIND_UNK_TYPE = errors.New("unknown value type for bind") + var NOT_CONN_ERROR = errors.New("not connected") + var PKT_ERROR = errors.New("malformed packet") + var PKT_LONG_ERROR = errors.New("packet too long") + var READ_AFTER_EOR_ERROR = errors.New("previous GetRow call returned nil row") + var RESULT_COUNT_ERROR = errors.New("wrong number of result columns") + var SEQ_ERROR = errors.New("packet sequence error") + var SMALL_PKT_SIZE_ERROR = errors.New("specified packet size is to small") + var UNEXP_NULL_DATE_ERROR = errors.New("unexpected NULL DATETIME") + var UNEXP_NULL_LCB_ERROR = errors.New("unexpected NULL LCB") + var UNEXP_NULL_LCS_ERROR = errors.New("unexpected NULL LCS") + var UNEXP_NULL_TIME_ERROR = errors.New("unexpected NULL TIME") + var UNK_DATA_TYPE_ERROR = errors.New("unknown data source type") + var UNK_MYSQL_TYPE_ERROR = errors.New("unknown MySQL type") + var UNK_RESULT_PKT_ERROR = errors.New("unexpected or unknown result packet") + var UNREADED_REPLY_ERROR = errors.New("reply is not completely read") + var WRONG_DATE_LEN_ERROR = errors.New("wrong datetime/timestamp length") + var WRONG_PARAM_NUM_ERROR = errors.New("wrong parameter number") + var WRONG_TIME_LEN_ERROR = errors.New("wrong time length") + func DecodeU16(buf []byte) uint16 + func DecodeU24(buf []byte) uint32 + func DecodeU32(buf []byte) uint32 + func DecodeU64(buf []byte) (rv uint64) + func EncodeDate(d mysql.Date) []byte + func EncodeDuration(d time.Duration) []byte + func EncodeTime(t time.Time) []byte + func EncodeU16(val uint16) []byte + func EncodeU24(val uint32) []byte + func EncodeU32(val uint32) []byte + func EncodeU64(val uint64) []byte + func NbinToNstr(nbin *[]byte) *string + func New(proto, laddr, raddr, user, passwd string, db ...string) mysql.Conn + func NstrToNbin(nstr *string) *[]byte + type Conn struct + Debug bool + func (my *Conn) Begin() (mysql.Transaction, error) + func (my *Conn) Close() (err error) + func (my *Conn) Connect() (err error) + func (my *Conn) EscapeString(txt string) string + func (my *Conn) IsConnected() bool + func (my *Conn) Ping() (err error) + func (my *Conn) Prepare(sql string) (mysql.Stmt, error) + func (my *Conn) Query(sql string, params ...interface{}) ([]mysql.Row, mysql.Result, error) + func (my *Conn) Reconnect() (err error) + func (my *Conn) Register(sql string) + func (my *Conn) SetMaxPktSize(new_size int) int + func (my *Conn) Start(sql string, params ...interface{}) (res mysql.Result, err error) + func (my *Conn) ThreadId() uint32 + func (my *Conn) Use(dbname string) (err error) + type Result struct + func (res *Result) AffectedRows() uint64 + func (res *Result) End() error + func (res *Result) Fields() []*mysql.Field + func (res *Result) GetRow() (row mysql.Row, err error) + func (res *Result) GetRows() ([]mysql.Row, error) + func (res *Result) InsertId() uint64 + func (res *Result) Map(field_name string) int + func (res *Result) Message() string + func (res *Result) MoreResults() bool + func (res *Result) NextResult() (mysql.Result, error) + func (res *Result) WarnCount() int + type Stmt struct + func (res *Stmt) Map(field_name string) int + func (stmt *Stmt) Bind(params ...interface{}) + func (stmt *Stmt) Delete() (err error) + func (stmt *Stmt) Exec(params ...interface{}) ([]mysql.Row, mysql.Result, error) + func (stmt *Stmt) NumField() int + func (stmt *Stmt) NumParam() int + func (stmt *Stmt) Reset() (err error) + func (stmt *Stmt) ResetParams() + func (stmt *Stmt) Run(params ...interface{}) (res mysql.Result, err error) + func (stmt *Stmt) SendLongData(pnum int, data interface{}, pkt_size int) (err error) + func (stmt *Stmt) WarnCount() int + type Transaction struct + func (tr Transaction) Commit() error + func (tr Transaction) Do(st mysql.Stmt) mysql.Stmt + func (tr Transaction) Rollback() error