resultset

package
v0.0.0-...-49f428d Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InterfaceSetter

func InterfaceSetter(d interface{}, columns []string, dest []interface{}) error

Types

type ExecResult

type ExecResult interface {
	LastInsertId() (int64, error)

	RowsAffected() (int64, error)
}

type QueryResult

type QueryResult interface {
	Columns() ([]string, error)

	Next() bool

	Scan(dest ...interface{}) error

	Close() error
}

type Result

type Result interface {
	QueryResult
	ExecResult
}

type SliceResult

type SliceResult[T any] struct {
	// contains filtered or unexported fields
}

func NewSliceResult

func NewSliceResult[T any](data []T, columns []string, setter ValueSetter) *SliceResult[T]

func (*SliceResult[T]) Close

func (r *SliceResult[T]) Close() error

func (*SliceResult[T]) Columns

func (r *SliceResult[T]) Columns() ([]string, error)

func (*SliceResult[T]) LastInsertId

func (r *SliceResult[T]) LastInsertId() (int64, error)

func (*SliceResult[T]) Next

func (r *SliceResult[T]) Next() bool

func (*SliceResult[T]) RowsAffected

func (r *SliceResult[T]) RowsAffected() (int64, error)

func (*SliceResult[T]) Scan

func (r *SliceResult[T]) Scan(dest ...interface{}) error

type SturctSetter

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

func NewSturctSetter

func NewSturctSetter(tagName string) *SturctSetter

func (*SturctSetter) Set

func (s *SturctSetter) Set(d interface{}, columns []string, dest []interface{}) error

type ValueSetter

type ValueSetter func(d interface{}, columns []string, dest []interface{}) error

Jump to

Keyboard shortcuts

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