sqlx

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = fmt.Errorf("not-found")

Functions

func Scan

func Scan[T any](sc *Scanner, rows *sql.Rows) (T, error)

func Transact

func Transact(db TransactionStarter, fn func(tx *sql.Tx) error) error

Transact encapsulates the call to fn into a transaction func Transact(db *sql.DB, fn func(tx *sql.Tx) error) error {

Types

type Rows

type Rows interface {
	Next() bool
	ColumnTypes() ([]*sql.ColumnType, error)
	Scan(...any) error
}

type ScanOptions

type ScanOptions struct {
	CaseInsensitive       bool
	DisallowUnknownFields bool
}

type Scanner

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

func NewScanner

func NewScanner(rows Rows, options *ScanOptions) (*Scanner, error)

func (*Scanner) Next

func (sc *Scanner) Next() bool

type TransactionStarter

type TransactionStarter interface {
	Begin() (*sql.Tx, error)
}

Jump to

Keyboard shortcuts

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