Documentation ¶
Index ¶
- func Columns(s *Scanner, it func(name string, typ internal.T))
- func Reset(s *Scanner, set *Ydb.ResultSet, columnNames ...string)
- type Scanner
- func (s *Scanner) Any() interface{}
- func (s *Scanner) AssertType(t ydb.Type) bool
- func (s *Scanner) Bool() (v bool)deprecated
- func (s *Scanner) ColumnCount() int
- func (s *Scanner) Date() (v uint32)deprecated
- func (s *Scanner) Datetime() (v uint32)deprecated
- func (s *Scanner) Decimal(t ydb.Type) (v [16]byte)
- func (s *Scanner) DictIn() (size int)
- func (s *Scanner) DictKey(i int)
- func (s *Scanner) DictOut()
- func (s *Scanner) DictPayload(i int)
- func (s *Scanner) Double() (v float64)deprecated
- func (s *Scanner) DyNumber() (v string)deprecated
- func (s *Scanner) Err() error
- func (s *Scanner) Float() (v float32)deprecated
- func (s *Scanner) HasItems() bool
- func (s *Scanner) HasNextItem() bool
- func (s *Scanner) HasNextRow() bool
- func (s *Scanner) Int16() (v int16)deprecated
- func (s *Scanner) Int32() (v int32)deprecated
- func (s *Scanner) Int64() (v int64)deprecated
- func (s *Scanner) Int8() (v int8)deprecated
- func (s *Scanner) Interval() (v int64)deprecated
- func (s *Scanner) IsDecimal() bool
- func (s *Scanner) IsNull() bool
- func (s *Scanner) IsOptional() bool
- func (s *Scanner) ItemCount() int
- func (s *Scanner) JSON() (v string)deprecated
- func (s *Scanner) JSONDocument() (v string)deprecated
- func (s *Scanner) ListIn() (size int)
- func (s *Scanner) ListItem(i int)
- func (s *Scanner) ListOut()
- func (s *Scanner) NextItem() (ok bool)
- func (s *Scanner) NextRow() bool
- func (s *Scanner) Null()
- func (s *Scanner) OBool() (v bool)deprecated
- func (s *Scanner) ODate() (v uint32)deprecated
- func (s *Scanner) ODatetime() (v uint32)deprecated
- func (s *Scanner) ODecimal(t ydb.Type) (v [16]byte)
- func (s *Scanner) ODouble() (v float64)deprecated
- func (s *Scanner) ODyNumber() (v string)deprecated
- func (s *Scanner) OFloat() (v float32)deprecated
- func (s *Scanner) OInt16() (v int16)deprecated
- func (s *Scanner) OInt32() (v int32)deprecated
- func (s *Scanner) OInt64() (v int64)deprecated
- func (s *Scanner) OInt8() (v int8)deprecated
- func (s *Scanner) OInterval() (v int64)deprecated
- func (s *Scanner) OJSON() (v string)deprecated
- func (s *Scanner) OJSONDocument() (v string)deprecated
- func (s *Scanner) OString() (v []byte)deprecated
- func (s *Scanner) OTimestamp() (v uint64)deprecated
- func (s *Scanner) OTzDate() (v string)deprecated
- func (s *Scanner) OTzDatetime() (v string)deprecated
- func (s *Scanner) OTzTimestamp() (v string)deprecated
- func (s *Scanner) OUTF8() (v string)deprecated
- func (s *Scanner) OUUID() (v [16]byte)deprecated
- func (s *Scanner) OUint16() (v uint16)deprecated
- func (s *Scanner) OUint32() (v uint32)deprecated
- func (s *Scanner) OUint64() (v uint64)deprecated
- func (s *Scanner) OUint8() (v uint8)deprecated
- func (s *Scanner) OYSON() (v string)deprecated
- func (s *Scanner) Path() string
- func (s *Scanner) ReadSingleRow(values ...interface{}) error
- func (s *Scanner) ResultSetTruncated() bool
- func (s *Scanner) RowCount() int
- func (s *Scanner) Scan(values ...interface{}) error
- func (s *Scanner) ScanWithDefaults(values ...interface{}) error
- func (s *Scanner) SeekItem(name string) bool
- func (s *Scanner) String() (v []byte)deprecated
- func (s *Scanner) StructField(i int) (name string)
- func (s *Scanner) StructIn() (size int)
- func (s *Scanner) StructOut()
- func (s *Scanner) Timestamp() (v uint64)deprecated
- func (s *Scanner) TupleIn() (size int)
- func (s *Scanner) TupleItem(i int)
- func (s *Scanner) TupleOut()
- func (s *Scanner) Type() ydb.Type
- func (s *Scanner) TzDate() (v string)deprecated
- func (s *Scanner) TzDatetime() (v string)deprecated
- func (s *Scanner) TzTimestamp() (v string)deprecated
- func (s *Scanner) UTF8() (v string)deprecated
- func (s *Scanner) UUID() (v [16]byte)deprecated
- func (s *Scanner) Uint16() (v uint16)deprecated
- func (s *Scanner) Uint32() (v uint32)deprecated
- func (s *Scanner) Uint64() (v uint64)deprecated
- func (s *Scanner) Uint8() (v uint8)deprecated
- func (s *Scanner) Unwrap()
- func (s *Scanner) UnwrapDecimal() (v [16]byte, precision, scale uint32)
- func (s *Scanner) Value() ydb.Value
- func (s *Scanner) Variant() (name string, index uint32)
- func (s *Scanner) WritePathTo(w io.Writer) (n int64, err error)
- func (s *Scanner) YSON() (v string)deprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 (*Scanner) ColumnCount ¶
ColumnCount returns number of columns in the current result set.
func (*Scanner) Decimal ¶
Decimal returns decimal value represented by big-endian 128 bit signed integes.
func (*Scanner) DictIn ¶
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 ¶
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 ¶
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) HasNextItem ¶
func (*Scanner) HasNextRow ¶
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) IsOptional ¶
func (*Scanner) JSONDocument
deprecated
func (*Scanner) ListIn ¶
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 ¶
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 ¶
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 ¶
NextRow selects next row in the current result set. It returns false if there are no more rows in the result set.
func (*Scanner) OJSONDocument
deprecated
func (*Scanner) OTimestamp
deprecated
func (*Scanner) OTzDatetime
deprecated
func (*Scanner) OTzTimestamp
deprecated
func (*Scanner) ReadSingleRow ¶ added in v2.4.0
ReadSingleRow scan one row
func (*Scanner) ResultSetTruncated ¶
ResultSetTruncated returns true if current result set has been truncated by server
func (*Scanner) Scan ¶ added in v2.4.0
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
ScanWithDefaults scan with default type values. Nil values applied as default value type Input params - pointers to types.
func (*Scanner) SeekItem ¶
SeekItem finds the column with given name in the result set and selects appropriate item to parse in the current row.
func (*Scanner) StructField ¶
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 ¶
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) TupleIn ¶
TupleIn interprets current item under scan as a ydb's tuple. It returns the size of the nested items.
func (*Scanner) TupleItem ¶
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) TzDatetime
deprecated
func (*Scanner) TzTimestamp
deprecated
func (*Scanner) Unwrap ¶
func (s *Scanner) Unwrap()
Unwrap unwraps current item under scan interpreting it as Optional<T> type.
func (*Scanner) UnwrapDecimal ¶
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