rowscanner

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DateTimeFormats map[string]string = map[string]string{
	"TIMESTAMP": "2006-01-02 15:04:05.999999999",
	"DATE":      "2006-01-02",
}

Expected formats for TIMESTAMP and DATE types when represented by a string value

View Source
var ErrRowsParseValue = "databricks: unable to parse %s value '%v' from column %s"

Functions

func GetDBType

func GetDBType(column *cli_service.TColumnDesc) cli_service.TTypeId

func GetDBTypeID

func GetDBTypeID(column *cli_service.TColumnDesc) cli_service.TTypeId

GetDBTypeID returns the database type ID from a TColumnDesc

func GetDBTypeName

func GetDBTypeName(column *cli_service.TColumnDesc) string

GetDBTypeName returns the database type name from a TColumnDesc

func GetDBTypeQualifiers

func GetDBTypeQualifiers(column *cli_service.TColumnDesc) *cli_service.TTypeQualifiers

GetDBTypeQualifiers returns the TTypeQualifiers from a TColumnDesc. Return value may be nil.

func HandleDateTime

func HandleDateTime(val any, dbType, columnName string, location *time.Location) (result any, err error)

handleDateTime will convert the passed val to a time.Time value if necessary

func IsNull

func IsNull(nulls []byte, position int64) bool

IsNull return true if the bit at the provided position is set

Types

type RowScanner

type RowScanner interface {
	// ScanRow is called to populate the provided slice with the
	// content of the current row. The provided slice will be the same
	// size as the number of columns.
	// The dest should not be written to outside of ScanRow. Care
	// should be taken when closing a RowScanner not to modify
	// a buffer held in dest.
	ScanRow(dest []driver.Value, rowIndex int64) dbsqlerr.DBError

	// NRows returns the number of rows in the current result page
	NRows() int64

	// Close any open resources
	Close()
}

RowScanner is an interface defining the behaviours that are specific to the formats in which query results can be returned.

Jump to

Keyboard shortcuts

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