Help us shape the future of Go! Take the 2026 Go Developer Survey

sqlmock

package
v2.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyArg

func AnyArg() sqlmock.Argument

func AnyArgs

func AnyArgs(n int) (args []driver.Value)

func GetColumns

func GetColumns(dest any) ([]string, error)

func GetValues

func GetValues(dest any, columns []string) ([]driver.Value, error)

func MockRows

func MockRows[T any](objs ...*T) *sqlmock.Rows

func NewMockPG

func NewMockPG(tb TestingTB) (*gorm.DB, sqlmock.Sqlmock)

func NewResult

func NewResult(lastInsertID, rowsAffected int64) driver.Result

func NewRows

func NewRows(columns ...string) *sqlmock.Rows

Types

type AnyTime

type AnyTime struct{}

func (AnyTime) Match

func (a AnyTime) Match(v driver.Value) bool

Match satisfies sqlmock.Argument interface

type TestingTB

type TestingTB interface {
	// Name Returns current test name.
	Name() string
	Cleanup(f func())
	Logf(fmt string, args ...any)
	Fatalf(format string, args ...any)
	Errorf(message string, args ...any)
}

Jump to

Keyboard shortcuts

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