stdsql

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exec

func Exec(ctx context.Context, db *sqlx.DB, sql string) error

func QueryAndProcessMany

func QueryAndProcessMany[T any](ctx context.Context, conn *sqlx.DB, sql string, handler func(ctx context.Context, rows []*T) error, opts ...exec.QueryManyOpt[T]) error

func QueryMany

func QueryMany[T any](ctx context.Context, conn *sqlx.DB, sql string, opts ...exec.QueryManyOpt[T]) ([]*T, error)

func QueryMaps

func QueryMaps(ctx context.Context, conn *sqlx.DB, sql string) ([]exec.QueryMapResult, error)

Types

type StdSqlExecutor

type StdSqlExecutor interface {
	GetDb() *sqlx.DB
	QueryRows(ctx context.Context, q string, args ...interface{}) (*sqlx.Rows, error)
}

type StdSqlQuerier

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

func NewQuerier

func NewQuerier[T any](conn *sqlx.DB) *StdSqlQuerier[T]

func (StdSqlQuerier[T]) Close

func (s StdSqlQuerier[T]) Close() error

func (StdSqlQuerier[T]) Exec

func (s StdSqlQuerier[T]) Exec(ctx context.Context, sql string) error

func (StdSqlQuerier[T]) QueryAndProcessMany

func (s StdSqlQuerier[T]) QueryAndProcessMany(ctx context.Context, sql string, handler func(ctx context.Context, batch []*T) error, opts ...exec.QueryManyOpt[T]) error

func (StdSqlQuerier[T]) QueryMany

func (s StdSqlQuerier[T]) QueryMany(ctx context.Context, sql string, opts ...exec.QueryManyOpt[T]) ([]*T, error)

func (StdSqlQuerier[T]) QueryMaps

func (s StdSqlQuerier[T]) QueryMaps(ctx context.Context, sql string) ([]exec.QueryMapResult, error)

Jump to

Keyboard shortcuts

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