queries

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

README

queries

checks pkg.go.dev goreportcard codecov

[WIP] Convenience helpers for working with SQL queries.

Features

  • Builder: an fmt-based query builder with an API similar to strings.Builder.
  • Scanner: a query-to-struct scanner, a lightweight version of sqlx with a smaller and stricter API.

Usage

See examples.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ScanAll

func ScanAll(dst any, rows Rows) error

func ScanOne

func ScanOne(dst any, rows Rows) error

Types

type Builder

type Builder struct {
	Args []any
	// contains filtered or unexported fields
}

func (*Builder) Appendf

func (b *Builder) Appendf(format string, args ...any)

func (*Builder) String

func (b *Builder) String() string

type Rows

type Rows interface {
	Scan(...any) error
	Columns() ([]string, error)
	Next() bool
	Err() error
}

Directories

Path Synopsis
internal
assert
Package assert implements assertions for the standard testing package.
Package assert implements assertions for the standard testing package.
assert/EF
Package EF provides type aliases for the parent [assert] package.
Package EF provides type aliases for the parent [assert] package.

Jump to

Keyboard shortcuts

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