result

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Columns

func Columns(s *Scanner, it func(name string, typ internal.T))

func Reset

func Reset(s *Scanner, set *Ydb.ResultSet)

Types

type Scanner

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

func (*Scanner) Any

func (s *Scanner) Any() interface{}

Any returns any pritmitive value. Currently it may return one of this types:

bool
int8
uint8
int16
uint16
int32
uint32
int64
uint64
float32
float64
[]byte
string
[16]byte

Or untyped nil.

func (*Scanner) AssertType

func (s *Scanner) AssertType(t ydb.Type) bool

func (*Scanner) Bool

func (s *Scanner) Bool() (v bool)

func (*Scanner) ColumnCount

func (s *Scanner) ColumnCount() int

ColumnCount returns number of columns in the current result set.

func (*Scanner) Date

func (s *Scanner) Date() (v uint32)

func (*Scanner) Datetime

func (s *Scanner) Datetime() (v uint32)

func (*Scanner) Decimal

func (s *Scanner) Decimal(t ydb.Type) (v [16]byte)

Decimal returns decimal value represented by big-endian 128 bit signed integes.

func (*Scanner) DictIn

func (s *Scanner) DictIn() (size int)

DictIn interprets current item under scan as a ydb's dict. It returns the size of the nested items pairs. If there is no current item under scan it returns -1.

func (*Scanner) DictKey

func (s *Scanner) DictKey(i int)

DictKey selects current item i-th pair key as an item to scan. Note that DictIn() must be called before. It panics if i is out of bounds.

func (*Scanner) DictOut

func (s *Scanner) DictOut()

DictOut leaves dict entered before by DictIn() call.

func (*Scanner) DictPayload

func (s *Scanner) DictPayload(i int)

DictPayload selects current item i-th pair value as an item to scan. Note that DictIn() must be called before. It panics if i is out of bounds.

func (*Scanner) Double

func (s *Scanner) Double() (v float64)

func (*Scanner) DyNumber

func (s *Scanner) DyNumber() (v string)

func (*Scanner) Err

func (s *Scanner) Err() error

Err returns error caused scanner to be broken.

func (*Scanner) Float

func (s *Scanner) Float() (v float32)

func (*Scanner) HasItems

func (s *Scanner) HasItems() bool

func (*Scanner) HasNextItem

func (s *Scanner) HasNextItem() bool

func (*Scanner) HasNextRow

func (s *Scanner) HasNextRow() bool

HasNextRow reports whether result row may be advanced.

It may be useful to call HasNextRow() instead of NextRow() to look ahead without advancing the result rows.

func (*Scanner) Int16

func (s *Scanner) Int16() (v int16)

func (*Scanner) Int32

func (s *Scanner) Int32() (v int32)

func (*Scanner) Int64

func (s *Scanner) Int64() (v int64)

func (*Scanner) Int8

func (s *Scanner) Int8() (v int8)

func (*Scanner) Interval

func (s *Scanner) Interval() (v int64)

func (*Scanner) IsDecimal

func (s *Scanner) IsDecimal() bool

func (*Scanner) IsNull

func (s *Scanner) IsNull() bool

func (*Scanner) IsOptional

func (s *Scanner) IsOptional() bool

func (*Scanner) ItemCount

func (s *Scanner) ItemCount() int

ItemCount returns number of items in the current row.

func (*Scanner) JSON

func (s *Scanner) JSON() (v string)

func (*Scanner) JSONDocument

func (s *Scanner) JSONDocument() (v string)

func (*Scanner) ListIn

func (s *Scanner) ListIn() (size int)

ListIn interprets current item under scan as a ydb's list. It returns the size of the nested items. If current item under scan is not a list type, it returns -1.

func (*Scanner) ListItem

func (s *Scanner) ListItem(i int)

ListItem selects current item i-th element as an item to scan. ListIn() must be called before.

func (*Scanner) ListOut

func (s *Scanner) ListOut()

ListOut leaves list entered before by ListIn() call.

func (*Scanner) NextItem

func (s *Scanner) NextItem() (ok bool)

NextItem selects next item to parse in the current row. It returns false if there are no more items in the row.

Note that NextItem() differs from NextRow() and NextSet() – if it return false it fails the Result such that no further operations may be processed. That is, res.Err() becomes non-nil.

func (*Scanner) NextRow

func (s *Scanner) NextRow() bool

NextRow selects next row in the current result set. It returns false if there are no more rows in the result set.

func (*Scanner) Null

func (s *Scanner) Null()

func (*Scanner) OBool

func (s *Scanner) OBool() (v bool)

func (*Scanner) ODate

func (s *Scanner) ODate() (v uint32)

func (*Scanner) ODatetime

func (s *Scanner) ODatetime() (v uint32)

func (*Scanner) ODecimal

func (s *Scanner) ODecimal(t ydb.Type) (v [16]byte)

func (*Scanner) ODouble

func (s *Scanner) ODouble() (v float64)

func (*Scanner) ODyNumber

func (s *Scanner) ODyNumber() (v string)

func (*Scanner) OFloat

func (s *Scanner) OFloat() (v float32)

func (*Scanner) OInt16

func (s *Scanner) OInt16() (v int16)

func (*Scanner) OInt32

func (s *Scanner) OInt32() (v int32)

func (*Scanner) OInt64

func (s *Scanner) OInt64() (v int64)

func (*Scanner) OInt8

func (s *Scanner) OInt8() (v int8)

func (*Scanner) OInterval

func (s *Scanner) OInterval() (v int64)

func (*Scanner) OJSON

func (s *Scanner) OJSON() (v string)

func (*Scanner) OJSONDocument

func (s *Scanner) OJSONDocument() (v string)

func (*Scanner) OString

func (s *Scanner) OString() (v []byte)

func (*Scanner) OTimestamp

func (s *Scanner) OTimestamp() (v uint64)

func (*Scanner) OTzDate

func (s *Scanner) OTzDate() (v string)

func (*Scanner) OTzDatetime

func (s *Scanner) OTzDatetime() (v string)

func (*Scanner) OTzTimestamp

func (s *Scanner) OTzTimestamp() (v string)

func (*Scanner) OUTF8

func (s *Scanner) OUTF8() (v string)

func (*Scanner) OUUID

func (s *Scanner) OUUID() (v [16]byte)

func (*Scanner) OUint16

func (s *Scanner) OUint16() (v uint16)

func (*Scanner) OUint32

func (s *Scanner) OUint32() (v uint32)

func (*Scanner) OUint64

func (s *Scanner) OUint64() (v uint64)

func (*Scanner) OUint8

func (s *Scanner) OUint8() (v uint8)

func (*Scanner) OYSON

func (s *Scanner) OYSON() (v string)

func (*Scanner) Path

func (s *Scanner) Path() string

func (*Scanner) ResultSetTruncated

func (s *Scanner) ResultSetTruncated() bool

ResultSetTruncated returns true if current result set has been truncated by server

func (*Scanner) RowCount

func (s *Scanner) RowCount() int

RowCount returns number of rows in the result set.

func (*Scanner) SeekItem

func (s *Scanner) SeekItem(name string) bool

SeekItem finds the column with given name in the result set and selects appropriate item to parse in the current row.

func (*Scanner) String

func (s *Scanner) String() (v []byte)

func (*Scanner) StructField

func (s *Scanner) StructField(i int) (name string)

StructField selects current item i-th field value as an item to scan. Note that StructIn() must be called before. It panics if i is out of bounds.

func (*Scanner) StructIn

func (s *Scanner) StructIn() (size int)

StructIn interprets current item under scan as a ydb's struct. It returns the size of the nested items – the struct fields values. If there is no current item under scan it returns -1.

func (*Scanner) StructOut

func (s *Scanner) StructOut()

StructOut leaves struct entered before by StructIn() call.

func (*Scanner) Timestamp

func (s *Scanner) Timestamp() (v uint64)

func (*Scanner) TupleIn

func (s *Scanner) TupleIn() (size int)

TupleIn interprets current item under scan as a ydb's tuple. It returns the size of the nested items.

func (*Scanner) TupleItem

func (s *Scanner) TupleItem(i int)

TupleItem selects current item i-th element as an item to scan. Note that TupleIn() must be called before. It panics if i is out of bounds.

func (*Scanner) TupleOut

func (s *Scanner) TupleOut()

TupleOut leaves tuple entered before by TupleIn() call.

func (*Scanner) Type

func (s *Scanner) Type() ydb.Type

func (*Scanner) TzDate

func (s *Scanner) TzDate() (v string)

func (*Scanner) TzDatetime

func (s *Scanner) TzDatetime() (v string)

func (*Scanner) TzTimestamp

func (s *Scanner) TzTimestamp() (v string)

func (*Scanner) UTF8

func (s *Scanner) UTF8() (v string)

func (*Scanner) UUID

func (s *Scanner) UUID() (v [16]byte)

func (*Scanner) Uint16

func (s *Scanner) Uint16() (v uint16)

func (*Scanner) Uint32

func (s *Scanner) Uint32() (v uint32)

func (*Scanner) Uint64

func (s *Scanner) Uint64() (v uint64)

func (*Scanner) Uint8

func (s *Scanner) Uint8() (v uint8)

func (*Scanner) Unwrap

func (s *Scanner) Unwrap()

Unwrap unwraps current item under scan interpreting it as Optional<T> type.

func (*Scanner) UnwrapDecimal

func (s *Scanner) UnwrapDecimal() (v [16]byte, precision, scale uint32)

UnwrapDecimal returns decimal value represented by big-endian 128 bit signed integer and its type information.

func (*Scanner) Value

func (s *Scanner) Value() ydb.Value

Value returns current item under scan as ydb.Value type.

func (*Scanner) Variant

func (s *Scanner) Variant() (name string, index uint32)

Variant unwraps current item under scan interpreting it as Variant<T> type. It returns non-empty name of a field that is filled for struct-based variant. It always returns an index of filled field of a T.

func (*Scanner) WritePathTo

func (s *Scanner) WritePathTo(w io.Writer) (n int64, err error)

func (*Scanner) YSON

func (s *Scanner) YSON() (v string)

Jump to

Keyboard shortcuts

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