scanner

package
v3.0.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrepareScannerPerformanceTest

func PrepareScannerPerformanceTest(count int) *scanner

Types

type Result

type Result struct {
	Sets       []*Ydb.ResultSet
	QueryStats *Ydb_TableStats.QueryStats

	SetCh       chan *Ydb.ResultSet
	SetChErr    *error
	SetChCancel func()
	// contains filtered or unexported fields
}

func (*Result) Close

func (r *Result) Close() error

Close closes the Result, preventing further iteration.

func (*Result) ColumnCount

func (s *Result) ColumnCount() int

ColumnCount returns number of columns in the current result set.

func (*Result) Columns

func (s *Result) Columns(it func(options.Column))

Columns allows to iterate over all columns of the current result set.

func (*Result) CurrentResultSet

func (r *Result) CurrentResultSet() resultset.ResultSet

CurrentResultSet get current result set

func (*Result) Err

func (s *Result) Err() error

Err returns error caused Scanner to be broken.

func (*Result) HasNextResultSet

func (r *Result) HasNextResultSet() bool

HasNextResultSet reports whether result set may be advanced. It may be useful to call HasNextResultSet() instead of NextResultSet() to look ahead without advancing the result set. Note that it does not work with sets from stream.

func (*Result) HasNextRow

func (s *Result) 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 (*Result) ItemCount

func (s *Result) ItemCount() int

ItemCount returns number of items in the current row.

func (*Result) NextResultSet

func (r *Result) NextResultSet(ctx context.Context, columns ...string) bool

NextResultSet selects next result set in the result. columns - names of columns in the resultSet that will be scanned It returns false if there are no more result sets. Stream sets are supported.

func (*Result) NextRow

func (s *Result) 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 (*Result) ResultSetCount

func (r *Result) ResultSetCount() int

ResultSetCount returns number of result sets. Note that it does not work if r is the result of streaming operation.

func (*Result) RowCount

func (s *Result) RowCount() int

RowCount returns number of rows in the result set.

func (*Result) Scan

func (s *Result) 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 sql.Scanner interface. For optional types use double pointer construction. For unknown types use interface types. Supported scanning byte arrays of various length. For complex yql types: Dict, List, Tuple and own specific scanning logic implement ydb.Scanner with UnmarshalYDB method See examples for more detailed information. Output param - Scanner error

func (*Result) ScanWithDefaults

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

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

func (*Result) Stats

func (r *Result) Stats() stats.QueryStats

Stats returns query execution QueryStats.

func (*Result) TotalRowCount

func (r *Result) TotalRowCount() (n int)

TotalRowCount returns the number of rows among the all result sets. Note that it does not work if r is the result of streaming operation.

func (*Result) Truncated

func (s *Result) Truncated() bool

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

Jump to

Keyboard shortcuts

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