sqlmock

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 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 ...interface{})
	Fatalf(format string, args ...interface{})
	Errorf(message string, args ...interface{})
}

Jump to

Keyboard shortcuts

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