mysql

package
v0.0.0-...-9a5932e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2014 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DUP_ENTRY         = C.ER_DUP_ENTRY
	LOCK_WAIT_TIMEOUT = C.ER_LOCK_WAIT_TIMEOUT
	LOCK_DEADLOCK     = C.ER_LOCK_DEADLOCK

	REDACTED_PASSWORD = "****"
)

Variables

This section is empty.

Functions

func BuildValue

func BuildValue(bytes []byte, fieldType uint32) sqltypes.Value

Types

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

func Connect

func Connect(params ConnectionParams) (conn *Connection, err error)

func (*Connection) Close

func (conn *Connection) Close()

func (*Connection) CloseResult

func (conn *Connection) CloseResult()

func (*Connection) ExecuteFetch

func (conn *Connection) ExecuteFetch(query string, maxrows int, wantfields bool) (qr *proto.QueryResult, err error)

func (*Connection) ExecuteStreamFetch

func (conn *Connection) ExecuteStreamFetch(query string) (err error)

when using ExecuteStreamFetch, use FetchNext on the Connection until it returns nil or error

func (*Connection) FetchNext

func (conn *Connection) FetchNext() (row []sqltypes.Value, err error)

func (*Connection) Fields

func (conn *Connection) Fields() (fields []proto.Field)

func (*Connection) Id

func (conn *Connection) Id() int64

func (*Connection) IsClosed

func (conn *Connection) IsClosed() bool

type ConnectionParams

type ConnectionParams struct {
	Host       string `json:"host"`
	Port       int    `json:"port"`
	Uname      string `json:"uname"`
	Pass       string `json:"pass"`
	DbName     string `json:"dbname"`
	UnixSocket string `json:"unix_socket"`
	Charset    string `json:"charset"`
	Flags      uint64 `json:"flags"`

	// the following flags are only used for 'Change Master' command
	// for now (along with flags |= 2048 for CLIENT_SSL)
	SslCa     string `json:"ssl_ca"`
	SslCaPath string `json:"ssl_ca_path"`
	SslCert   string `json:"ssl_cert"`
	SslKey    string `json:"ssl_key"`
}

func (*ConnectionParams) EnableMultiStatements

func (c *ConnectionParams) EnableMultiStatements()

func (*ConnectionParams) Redact

func (c *ConnectionParams) Redact()

func (*ConnectionParams) SslEnabled

func (c *ConnectionParams) SslEnabled() bool

type SqlError

type SqlError struct {
	Num     int
	Message string
	Query   string
}

func NewSqlError

func NewSqlError(number int, format string, args ...interface{}) *SqlError

func (*SqlError) Error

func (se *SqlError) Error() string

func (*SqlError) Number

func (se *SqlError) Number() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL