sql

package module
v0.0.0-...-27647ab Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exec

func Exec(ctx context.Context, o sqb.Querier, objs ...any) error

func MakeAnyColumns

func MakeAnyColumns(names ...string) []sqb.Column

func MakeQuery

func MakeQuery(ctx context.Context, mode sqb.QueryMode, ad sqb.Adapter, objs ...any) (sqb.Query, error)

func MaybeFirst

func MaybeFirst(ctx context.Context, o sqb.Querier, objs ...any) (bt.Optional[Row], error)

func MaybeOne

func MaybeOne(ctx context.Context, o sqb.Querier, objs ...any) (bt.Optional[Row], error)

func Query

func Query(ctx context.Context, o sqb.Querier, objs ...any) (sqb.Rows, error)

func Scalar

func Scalar(ctx context.Context, o sqb.Querier, objs ...any) (any, error)

func ScanMap

func ScanMap(cs []sqb.Column, scan RowScanner) (map[string]any, error)

Types

type Adapter

type Adapter = sqb.Adapter

type Column

type Column = sqb.Column

type Columns

type Columns = sqb.Columns

type Conn

type Conn = sqb.Conn

type Db

type Db = sqb.Db

type MultipleFoundError

type MultipleFoundError struct{}

func (MultipleFoundError) Error

func (e MultipleFoundError) Error() string

type NotEnoughValuesError

type NotEnoughValuesError struct{}

func (NotEnoughValuesError) Error

func (e NotEnoughValuesError) Error() string

type NotFoundError

type NotFoundError struct{}

func (NotFoundError) Error

func (e NotFoundError) Error() string

type Querier

type Querier = sqb.Querier

type Row

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

func All

func All(ctx context.Context, o sqb.Querier, objs ...any) (s []Row, err error)

func First

func First(ctx context.Context, o sqb.Querier, objs ...any) (Row, error)

func One

func One(ctx context.Context, o sqb.Querier, objs ...any) (Row, error)

func (Row) Clone

func (r Row) Clone() Row

func (Row) Columns

func (r Row) Columns() *sqb.Columns

func (Row) Contains

func (r Row) Contains(k string) bool

func (Row) ForEach

func (r Row) ForEach(fn func(kv bt.Kv[string, any]) bool) bool

func (Row) Format

func (r Row) Format(f fmt.State, c rune)

func (Row) Get

func (r Row) Get(k string) any

func (Row) Iterate

func (r Row) Iterate() bt.Iterator[bt.Kv[string, any]]

func (Row) Len

func (r Row) Len() int

func (Row) MarshalJSON

func (r Row) MarshalJSON() ([]byte, error)

func (Row) TryGet

func (r Row) TryGet(k string) (any, bool)

func (Row) Value

func (r Row) Value(i int) any

func (Row) Values

func (r Row) Values() []any

type RowReader

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

func NewRowReader

func NewRowReader(r sqb.Rows) (RowReader, error)

func (RowReader) Columns

func (rr RowReader) Columns() *sqb.Columns

func (RowReader) Read

func (rr RowReader) Read() (Row, error)

type RowScanner

type RowScanner func(dst ...any) error

type Rows

type Rows = sqb.Rows

type RowsIterator

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

func Iter

func Iter(ctx context.Context, o sqb.Querier, objs ...any) (*RowsIterator, error)

func IterRows

func IterRows(br sqb.Rows) *RowsIterator

func (*RowsIterator) Close

func (ri *RowsIterator) Close() error

func (*RowsIterator) Columns

func (ri *RowsIterator) Columns() (*sqb.Columns, error)

func (*RowsIterator) HasNext

func (ri *RowsIterator) HasNext() bool

func (*RowsIterator) Iterate

func (ri *RowsIterator) Iterate() bt.Iterator[bt.Result[Row]]

func (*RowsIterator) Next

func (ri *RowsIterator) Next() bt.Result[Row]

type TooManyValuesError

type TooManyValuesError struct{}

func (TooManyValuesError) Error

func (e TooManyValuesError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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