xapi

package
Version: v0.0.0-...-815d2fd Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColumnsToProto

func ColumnsToProto(columns []*model.ColumnInfo, pkIsHandle bool) []*tipb.ColumnInfo

ColumnsToProto converts a slice of model.ColumnInfo to a slice of tipb.ColumnInfo.

func EncodeIndexRanges

func EncodeIndexRanges(tid, idxID int64, rans []*tipb.KeyRange) []kv.KeyRange

EncodeIndexRanges encodes index ranges into kv.KeyRanges.

func EncodeTableRanges

func EncodeTableRanges(tid int64, rans []*tipb.KeyRange) []kv.KeyRange

EncodeTableRanges encodes table ranges into kv.KeyRanges.

func FieldTypeFromPBColumn

func FieldTypeFromPBColumn(col *tipb.ColumnInfo) *types.FieldType

FieldTypeFromPBColumn creates a types.FieldType from tipb.ColumnInfo.

func IndexToProto

func IndexToProto(t *model.TableInfo, idx *model.IndexInfo) *tipb.IndexInfo

IndexToProto converts a model.IndexInfo to a tipb.IndexInfo.

func ProtoColumnsToFieldTypes

func ProtoColumnsToFieldTypes(pColumns []*tipb.ColumnInfo) []*types.FieldType

ProtoColumnsToFieldTypes converts tipb column info slice to FieldTyps slice.

func SupportExpression

func SupportExpression(client kv.Client, expr *tipb.Expr) bool

SupportExpression checks if the expression is supported by the client.

Types

type SelectResult

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

SelectResult is used to get response rows from SelectRequest.

func Select

func Select(client kv.Client, req *tipb.SelectRequest, concurrency int) (*SelectResult, error)

Select do a select request, returns SelectResult.

func (*SelectResult) Close

func (r *SelectResult) Close() error

Close closes SelectResult.

func (*SelectResult) Next

func (r *SelectResult) Next() (subResult *SubResult, err error)

Next returns the next row.

func (*SelectResult) SetFields

func (r *SelectResult) SetFields(fields []*types.FieldType)

SetFields sets select result field types.

type SubResult

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

SubResult represents a subset of select result.

func (*SubResult) Close

func (r *SubResult) Close() error

Close closes the sub result.

func (*SubResult) Next

func (r *SubResult) Next() (handle int64, data []types.Datum, err error)

Next returns the next row of the sub result. If no more row to return, data would be nil.

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL