kvsql

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SizeInt64      = int(unsafe.Sizeof(int64(0)))
	SizeUint64     = int(unsafe.Sizeof(uint64(0)))
	SizeFloat32    = int(unsafe.Sizeof(float32(0)))
	SizeFloat64    = int(unsafe.Sizeof(float64(0)))
	SizeGoDuration = int(unsafe.Sizeof(time.Duration(0)))
	SizeTime       = int(unsafe.Sizeof(types.ZeroTime))
)

nolint will use later

View Source
const (
	RawSql = 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk

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

Chunk stores multiple rows of data in Apache Arrow format. See https://arrow.apache.org/docs/memory_layout.html Values are appended in compact format and can be directly accessed without decoding. When the chunk is done processing, we can reuse the allocated memory by resetting it.

func NewChunkWithColumn

func NewChunkWithColumn(columns []*Column) *Chunk

NewChunkWithColumn create a empty chunk to resultChunk

func (*Chunk) GetRow

func (c *Chunk) GetRow(idx int) Row

GetRow gets the Row in the chunk with the row index.

func (*Chunk) NumCols

func (c *Chunk) NumCols() int

NumCols returns the number of columns in the chunk.

func (*Chunk) NumRows

func (c *Chunk) NumRows() int

NumRows returns the number of rows in the chunk.

type Column

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

Column stores one column of data in Apache Arrow format. See https://arrow.apache.org/docs/memory_layout.html

func NewColumnWithData

func NewColumnWithData(data []byte, nullBitmap []byte, offsets []int64) *Column

NewColumnWithData create a new column with data、nullBitmap and offsets

func (*Column) GetBytes

func (c *Column) GetBytes(rowID int) []byte

GetBytes returns the byte slice in the specific row.

func (*Column) GetDecimal

func (c *Column) GetDecimal(rowID int) *types.MyDecimal

GetDecimal returns the decimal in the specific row.

func (*Column) GetDuration

func (c *Column) GetDuration(rowID int, fillFsp int) types.Duration

GetDuration returns the Duration in the specific row.

func (*Column) GetEnum

func (c *Column) GetEnum(rowID int) types.Enum

GetEnum returns the Enum in the specific row.

func (*Column) GetFloat32

func (c *Column) GetFloat32(rowID int) float32

GetFloat32 returns the float32 in the specific row.

func (*Column) GetFloat64

func (c *Column) GetFloat64(rowID int) float64

GetFloat64 returns the float64 in the specific row.

func (*Column) GetInt64

func (c *Column) GetInt64(rowID int) int64

GetInt64 returns the int64 in the specific row.

func (*Column) GetSet

func (c *Column) GetSet(rowID int) types.Set

GetSet returns the Set in the specific row.

func (*Column) GetString

func (c *Column) GetString(rowID int) string

GetString returns the string in the specific row.

func (*Column) GetTime

func (c *Column) GetTime(rowID int) types.Time

GetTime returns the Time in the specific row.

func (*Column) GetUint64

func (c *Column) GetUint64(rowID int) uint64

GetUint64 returns the uint64 in the specific row.

func (*Column) IsNull

func (c *Column) IsNull(rowIdx int) bool

IsNull returns if this row is null.

type ExecuteResult

type ExecuteResult struct {
	ColumnCount  uint32          `json:"column_count"`
	LastInsertID uint64          `json:"last_insert_id"`
	UpdatedCount uint32          `json:"updated_count"`
	Columns      []string        `json:"columns"`
	RowNumber    int             `json:"row_number"`
	Result       [][]interface{} `json:"result"`
}

func (ExecuteResult) String

func (rs ExecuteResult) String() string

type Field

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

type ResultSet

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

func DecodeRecordSet

func DecodeRecordSet(buf []byte) *ResultSet

DecodeRecordSet use this method to decode call ret to a ResultSet Object

func (ResultSet) ColumnCount

func (c ResultSet) ColumnCount() uint32

func (ResultSet) Columns

func (c ResultSet) Columns() []string

func (*ResultSet) GetRow

func (rs *ResultSet) GetRow(rowIndex int) Row

func (ResultSet) LastInsertID

func (c ResultSet) LastInsertID() uint64

func (ResultSet) RowNumber

func (c ResultSet) RowNumber() int

func (*ResultSet) ToExecuteResult

func (rs *ResultSet) ToExecuteResult() (*ExecuteResult, error)

func (ResultSet) UpdatedCount

func (c ResultSet) UpdatedCount() uint32

type Row

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

Row represents a row of data, can be used to access values.

func (Row) Chunk

func (r Row) Chunk() *Chunk

Chunk returns the Chunk which the row belongs to.

func (Row) GetBytes

func (r Row) GetBytes(colIdx int) []byte

GetBytes returns the bytes value with the colIdx.

func (Row) GetDecimal

func (r Row) GetDecimal(colIdx int) *types.MyDecimal

GetDecimal returns the MyDecimal value with the colIdx.

func (Row) GetDuration

func (r Row) GetDuration(colIdx int, fillFsp int) types.Duration

GetDuration returns the Duration value with the colIdx.

func (Row) GetEnum

func (r Row) GetEnum(colIdx int) types.Enum

GetEnum returns the Enum value with the colIdx.

func (Row) GetFloat32

func (r Row) GetFloat32(colIdx int) float32

GetFloat32 returns the float32 value with the colIdx.

func (Row) GetFloat64

func (r Row) GetFloat64(colIdx int) float64

GetFloat64 returns the float64 value with the colIdx.

func (Row) GetInt16

func (r Row) GetInt16(colIdx int) int16

GetInt16 returns the int16 value with the colIdx.

func (Row) GetInt32

func (r Row) GetInt32(colIdx int) int32

GetInt32 returns the int32 value with the colIdx.

func (Row) GetInt64

func (r Row) GetInt64(colIdx int) int64

GetInt64 returns the int64 value with the colIdx.

func (Row) GetInt8

func (r Row) GetInt8(colIdx int) int8

GetInt8 returns the int8 value with the colIdx.

func (Row) GetSet

func (r Row) GetSet(colIdx int) types.Set

GetSet returns the Set value with the colIdx.

func (Row) GetString

func (r Row) GetString(colIdx int) string

GetString returns the string value with the colIdx.

func (Row) GetTime

func (r Row) GetTime(colIdx int) types.Time

GetTime returns the Time value with the colIdx.

func (Row) GetUint16

func (r Row) GetUint16(colIdx int) uint16

GetUint16 returns the uint16 value with the colIdx.

func (Row) GetUint32

func (r Row) GetUint32(colIdx int) uint32

GetUint32 returns the uint8 value with the colIdx.

func (Row) GetUint64

func (r Row) GetUint64(colIdx int) uint64

GetUint64 returns the uint64 value with the colIdx.

func (Row) GetUint8

func (r Row) GetUint8(colIdx int) uint8

GetUint8 returns the uint8 value with the colIdx.

func (Row) Idx

func (r Row) Idx() int

Idx returns the row index of Chunk.

func (Row) IsEmpty

func (r Row) IsEmpty() bool

IsEmpty returns true if the Row is empty.

func (Row) IsNull

func (r Row) IsNull(colIdx int) bool

IsNull returns if the datum in the chunk.Row is null.

func (Row) Len

func (r Row) Len() int

Len returns the number of values in the row.

Directories

Path Synopsis
util

Jump to

Keyboard shortcuts

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