scanner

package
v0.0.0-...-e158608 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrForecastProcedureResult = werror.InvalidArgument("forecast procedure execution result expected 2 columns", werror.WithID("dbsql.scanner.forecastscan"))

Functions

This section is empty.

Types

type BatchScan

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

func MustNewBatchScan

func MustNewBatchScan() *BatchScan

func NewBatchScan

func NewBatchScan() (*BatchScan, error)

func (*BatchScan) ScanAll

func (b *BatchScan) ScanAll(dst interface{}, rows Rows) error

func (*BatchScan) ScanOne

func (b *BatchScan) ScanOne(dst interface{}, rows Rows) error

func (*BatchScan) String

func (b *BatchScan) String() string

type DBScan

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

func MustNewDBScan

func MustNewDBScan() *DBScan

func NewDBScan

func NewDBScan() (*DBScan, error)

func (*DBScan) ScanAll

func (d *DBScan) ScanAll(dst interface{}, rows Rows) error

func (*DBScan) ScanOne

func (d *DBScan) ScanOne(dst interface{}, rows Rows) error

func (*DBScan) String

func (d *DBScan) String() string

type ForecastScan

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

func MustNewForecastScan

func MustNewForecastScan() *ForecastScan

func NewForecastScan

func NewForecastScan() (*ForecastScan, error)

func (*ForecastScan) ScanAll

func (f *ForecastScan) ScanAll(dst interface{}, rows Rows) error

func (*ForecastScan) ScanOne

func (f *ForecastScan) ScanOne(dst interface{}, rows Rows) error

func (*ForecastScan) String

func (f *ForecastScan) String() string

type FrameScan

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

func MustNewFrameScan

func MustNewFrameScan() *FrameScan

func NewFrameScan

func NewFrameScan() (*FrameScan, error)

func (*FrameScan) ScanAll

func (f *FrameScan) ScanAll(dst any, rows Rows) error

func (*FrameScan) ScanOne

func (f *FrameScan) ScanOne(dst any, rows Rows) error

func (*FrameScan) String

func (f *FrameScan) String() string

type Rows

type Rows interface {
	Close() error
	Err() error
	Next() bool
	Columns() ([]string, error)
	Types() ([]string, error)
	Scan(dest ...any) error
	NextResultSet() bool
	Values() ([]any, error)
}

Rows is an abstract database rows that dbscan can iterate over and get the data from. This interface is used to decouple from any particular database library.

type Scanner

type Scanner interface {
	String() string
	ScanOne(dst any, rows Rows) error
	ScanAll(dst any, rows Rows) error
}

Scanner used to configure dbscan API, scan batch results or frame with any values, returning its type.

In case of unique / check / foreign key violations, the driver returns error only after rows.Close call (or while rows.Next returns false). That's why we should parse database error while scanning rows also.

Jump to

Keyboard shortcuts

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