Documentation ¶
Overview ¶
Package tablet is an API compliant to the requirements of database/sql Open expects name to be "hostname:port/keyspace/shard" For query arguments, we assume place-holders in the query string in the form of :v0, :v1, etc.
Package tablet implements some additional error handling logic to make the client more robust in the face of transient problems with easy solutions.
Index ¶
- Constants
- Variables
- type Conn
- type Result
- func (result *Result) Close() error
- func (result *Result) Columns() []string
- func (result *Result) Err() error
- func (result *Result) Fields() []mproto.Field
- func (result *Result) LastInsertId() (int64, error)
- func (result *Result) Next() (row []interface{})
- func (result *Result) Rows() [][]sqltypes.Value
- func (result *Result) RowsAffected() (int64, error)
- func (result *Result) RowsRetrieved() int64
- type StreamResult
- type TabletError
- type Tx
- type VtConn
Constants ¶
View Source
const ( ErrTypeFatal = 1 //errors.New("vt: fatal: reresolve endpoint") ErrTypeRetry = 2 //errors.New("vt: retry: reconnect endpoint") ErrTypeApp = 3 //errors.New("vt: app level error") )
View Source
const ( DefaultReconnectDelay = 2 * time.Millisecond DefaultMaxAttempts = 2 DefaultTimeout = 30 * time.Second )
Variables ¶
View Source
var ( ErrNoNestedTxn = errors.New("vt: no nested transactions") ErrBadCommit = errors.New("vt: commit without corresponding begin") ErrBadRollback = errors.New("vt: rollback without corresponding begin") ErrNoLastInsertId = errors.New("vt: no LastInsertId available after streaming statement") ErrNoRowsAffected = errors.New("vt: no RowsAffected available after streaming statement") ErrFieldLengthMismatch = errors.New("vt: no RowsAffected available after streaming statement") )
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct { TransactionId int64 // contains filtered or unexported fields }
Not thread safe, as per sql package.
func DialTablet ¶
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
func (*Result) LastInsertId ¶
func (*Result) RowsAffected ¶
func (*Result) RowsRetrieved ¶
type StreamResult ¶
type StreamResult struct {
// contains filtered or unexported fields
}
func (*StreamResult) Close ¶
func (*StreamResult) Close() error
func (*StreamResult) Columns ¶
func (sr *StreamResult) Columns() (cols []string)
driver.Rows interface
func (*StreamResult) Err ¶
func (sr *StreamResult) Err() error
func (*StreamResult) LastInsertId ¶
func (*StreamResult) LastInsertId() (int64, error)
driver.Result interface
func (*StreamResult) Next ¶
func (sr *StreamResult) Next() (row []interface{})
func (*StreamResult) RowsAffected ¶
func (*StreamResult) RowsAffected() (int64, error)
type TabletError ¶
type TabletError struct {
// contains filtered or unexported fields
}
func (TabletError) Error ¶
func (te TabletError) Error() string
Click to show internal directories.
Click to hide internal directories.