rowscan

package
v0.0.0-...-4282750 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSingleTableName

func GetSingleTableName(query string) string

Types

type AliasConvert

type AliasConvert struct {
	Type      reflect.Type
	Converter func(typ reflect.Type, value reflect.Value, ns *NullAny)
}

type NullAny

type NullAny struct {
	Value     any
	ValueType ValueType
	Valid     bool
}

func (*NullAny) Scan

func (ns *NullAny) Scan(value any) error

Scan implements the Scanner interface.

type RowScanner

type RowScanner struct {
	Lookup map[string]map[string]string
	Rows   *sql.Rows

	RawFileDir   string
	RawFileExt   string
	Types        []ValueType
	LowerColumns []string
	Columns      []string
	SingleQuoted bool
}

func NewRowScanner

func NewRowScanner(query string, rows *sql.Rows, options ...RowScannerFn) (*RowScanner, error)

func (RowScanner) Next

func (s RowScanner) Next() bool

func (RowScanner) Scan

func (s RowScanner) Scan() ([]any, error)

type RowScannerFn

type RowScannerFn func(*RowScanner)

func WithLookup

func WithLookup(lookup map[string]map[string]string) RowScannerFn

func WithRawFile

func WithRawFile(dir, ext string) RowScannerFn

func WithSingleQuoted

func WithSingleQuoted(singleQuoted bool) RowScannerFn

type ValueType

type ValueType int
const (
	ValueTypeBool ValueType
	ValueTypeInt64
	ValueTypeFloat64
	ValueTypeString
	ValueTypeBytes
	ValueTypeOther
)

Jump to

Keyboard shortcuts

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