result

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: Apache-2.0 Imports: 11 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, columnNames ...string)

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 deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) ColumnCount

func (s *Scanner) ColumnCount() int

ColumnCount returns number of columns in the current result set.

func (*Scanner) Date deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) Datetime deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

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 deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) DyNumber deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) Err

func (s *Scanner) Err() error

Err returns error caused scanner to be broken.

func (*Scanner) Float deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

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 deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) Int32 deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) Int64 deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) Int8 deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) Interval deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

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 deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) JSONDocument deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

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 deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) ODate deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) ODatetime deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) ODecimal

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

func (*Scanner) ODouble deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) ODyNumber deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) OFloat deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) OInt16 deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) OInt32 deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) OInt64 deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) OInt8 deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) OInterval deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) OJSON deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) OJSONDocument deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) OString deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) OTimestamp deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) OTzDate deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) OTzDatetime deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) OTzTimestamp deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) OUTF8 deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) OUUID deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) OUint16 deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) OUint32 deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) OUint64 deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) OUint8 deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) OYSON deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) Path

func (s *Scanner) Path() string

func (*Scanner) ReadSingleRow added in v2.4.0

func (s *Scanner) ReadSingleRow(values ...interface{}) error

ReadSingleRow scan one row

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) Scan added in v2.4.0

func (s *Scanner) Scan(values ...interface{}) error

Scan values. Input params - pointers to types:

bool
int8
uint8
int16
uint16
int32
uint32
int64
uint64
float32
float64
[]byte
[16]byte
string
time.Time
time.Duration
ydb.Value

For custom types implement ydb.YdbScanner interface. For optional type use double pointer construction. For unknown types use interface type. Supported scanning byte arrays of various length. See examples for more detailed information. Output param - scanner error

func (*Scanner) ScanWithDefaults added in v2.4.0

func (s *Scanner) ScanWithDefaults(values ...interface{}) error

ScanWithDefaults scan with default type values. Nil values applied as default value type Input params - pointers to types.

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 deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

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 deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

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 deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) TzDatetime deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) TzTimestamp deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) UTF8 deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) UUID deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) Uint16 deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) Uint32 deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) Uint64 deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

func (*Scanner) Uint8 deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

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. Deprecated: Use Scan instead These methods will be removed at next major release

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 deprecated

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

Deprecated: Use Scan instead These methods will be removed at next major release

Jump to

Keyboard shortcuts

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