Documentation ¶
Overview ¶
Scan sql rows into any type powered by generics with proper error handling and automatic resource cleanup.
Index ¶
- Variables
- func All[T any](rows Rows, columns Columns[T]) ([]T, error)
- func First[T any](rows Rows, columns Columns[T]) (T, error)
- func Limit[T any](limit int, rows Rows, columns Columns[T]) ([]T, error)
- func One[T any](rows Rows, columns Columns[T]) (T, error)
- type Columns
- type Func
- type Iterator
- type Rows
- type Scanner
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoRows = errors.New("sql: no rows in result set")
ErrNoRows represents the error indicating no rows in the result set.
View Source
var ErrTooManyRows = errors.New("sql: too many rows in result set")
ErrTooManyRows represents the error indicating too many rows in the result set.
Functions ¶
Types ¶
type Func ¶ added in v0.0.8
Func is a function type that defines a custom scanner for a column.
func JSON ¶
JSON creates a custom scanner for a column containing JSON data with a specified scan function.
type Iterator ¶ added in v0.0.8
type Iterator[T any] struct { // contains filtered or unexported fields }
Iterator for scanning SQL rows.
Click to show internal directories.
Click to hide internal directories.