sqlbind

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package sqlbind provides generated, reflection-free database/sql row mapping.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(row Row, column string) (bool, error)

func Float64

func Float64(row Row, column string) (float64, error)

func ForEach

func ForEach(rows *sql.Rows, fn func(Row) error) error

ForEach scans rows without retaining the full result.

func Int

func Int(row Row, column string) (int, error)

func Int64

func Int64(row Row, column string) (int64, error)

func Key

func Key(row Row, column string) (key string, present bool, err error)

Key returns a stable grouping key. present is false for SQL NULL.

func RegisterScanRows

func RegisterScanRows[T any](fn func(*sql.Rows) ([]T, error))

RegisterScanRows registers a generated SQL tree scanner for T.

func RequiredKey

func RequiredKey(row Row, column string) (string, error)

RequiredKey is Key with NULL rejected for a root object.

func ScanRows

func ScanRows[T any](rows *sql.Rows) ([]T, error)

ScanRows maps joined SQL rows into a grouped object tree using generated code.

func String

func String(row Row, column string) (string, error)

Types

type Row

type Row map[string]any

Row is a SQL row indexed by result column name.

Jump to

Keyboard shortcuts

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