Documentation ¶
Index ¶
- Constants
- func BuildValue(bytes []byte, fieldType uint32) sqltypes.Value
- type Connection
- func (conn *Connection) Close()
- func (conn *Connection) CloseResult()
- func (conn *Connection) ExecuteFetch(query string, maxrows int, wantfields bool) (qr *proto.QueryResult, err error)
- func (conn *Connection) ExecuteStreamFetch(query string) (err error)
- func (conn *Connection) FetchNext() (row []sqltypes.Value, err error)
- func (conn *Connection) Fields() (fields []proto.Field)
- func (conn *Connection) Id() int64
- func (conn *Connection) IsClosed() bool
- type ConnectionParams
- type SqlError
Constants ¶
View Source
const ( DUP_ENTRY = C.ER_DUP_ENTRY LOCK_WAIT_TIMEOUT = C.ER_LOCK_WAIT_TIMEOUT LOCK_DEADLOCK = C.ER_LOCK_DEADLOCK OPTION_PREVENTS_STATEMENT = C.ER_OPTION_PREVENTS_STATEMENT REDACTED_PASSWORD = "****" )
Variables ¶
This section is empty.
Functions ¶
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
Click to show internal directories.
Click to hide internal directories.