result

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDataList

func CreateDataList(rows []Row) []any

func CreateDataScalar

func CreateDataScalar(rows []Row) any

func ParseRows

func ParseRows(dbRows *sql.Rows) ([]*Column, []*Row)

func ResolveTypes

func ResolveTypes(resolver database.SQLDialect, rowValue any, column Column) (any, error)

Types

type Body

type Body interface {
	fmt.Stringer
	Get() any
}

type Column

type Column struct {
	Name     string
	ScanType reflect.Type
	DBType   string
}

type Kind

type Kind int
const (
	KindNone Kind = iota
	KindRow
	KindScalar
	KindList
	KindTable
	KindSet
	KindObject
	KindMap
)

type List

type List struct {
	Values     []any
	DBTypeName string
	DBField    string
	ScanType   reflect.Type
	ActualType reflect.Type
	DBKind     string
}

func RowsToList

func RowsToList(dbRows *sql.Rows) List

func (List) Get

func (l List) Get() any

Value implements Response.

func (List) String

func (l List) String() string

String implements Response.

type Object

type Object struct {
	Fields map[string]any
	Type   string
}

func RowsToObject

func RowsToObject(rows *sql.Rows) (Object, error)

func (Object) Get

func (o Object) Get() any

func (Object) String

func (o Object) String() string

type Row

type Row struct {
	Values []any
}

func RowToRow

func RowToRow(sqlRow *sql.Row) (Row, error)

Please don't use

func (Row) Get

func (r Row) Get() any

Value implements Response.

func (Row) String

func (r Row) String() string

type Scalar

type Scalar struct {
	DBField string
	// contains filtered or unexported fields
}

func RowToScalar

func RowToScalar(row *sql.Row) (*Scalar, error)

func (Scalar) Get

func (s Scalar) Get() any

func (Scalar) String

func (s Scalar) String() string

type Table

type Table struct {
	Resolver database.SQLDialect
	// contains filtered or unexported fields
}

func NewTable

func NewTable(columns []*Column, rows []*Row) *Table

func (*Table) ClearRows

func (dt *Table) ClearRows() error

func (*Table) ColumnDatabaseTypeStrings

func (dt *Table) ColumnDatabaseTypeStrings() []string

func (*Table) ColumnNames

func (dt *Table) ColumnNames() []string

func (*Table) ColumnSlices

func (dt *Table) ColumnSlices() (names []string, types []string, dbTypes []string)

func (*Table) ColumnTypeStrings

func (dt *Table) ColumnTypeStrings() []string

func (*Table) Columns

func (dt *Table) Columns() []*Column

func (Table) Get

func (dt Table) Get() any

Value implements Response.

func (*Table) GetColumnRows

func (dt *Table) GetColumnRows(columnIndex int) (rows []string, columnWidth int)

func (*Table) GetRowColumn

func (dt *Table) GetRowColumn(row, column int) (string, error)

func (*Table) GetRowString

func (dt *Table) GetRowString(index int) string

func (*Table) GetRowStrings

func (dt *Table) GetRowStrings(index int) []string

func (*Table) GetRowStringsAll

func (dt *Table) GetRowStringsAll() [][]string

func (*Table) NumColumns

func (dt *Table) NumColumns() int

func (*Table) NumRows

func (dt *Table) NumRows() int

func (*Table) Rows

func (dt *Table) Rows() []*Row

func (Table) String

func (dt Table) String() string

Jump to

Keyboard shortcuts

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